Instead of currency symbol I get a question mark into the Command Prompt

It is by design.

.NET console application outputs text using some predefined system font (usually Lucida Console, but it can be Consolas or other similar font).

That font not necessary has symbol for your currency, so that symbol can be displayed incorrectly. See this link for supported currencies symbols in Lucida Console.

You can't easily fix it in console application just because it is not so easy to change font used for displaying text in console (it is possible with some WinAPI calls, I suppose).


Add

Console.OutputEncoding = System.Text.Encoding.Unicode;

before writing output.

You should also ensure the console font is TrueType.


Just add:

using System.Text;
Console.OutputEncoding = Encoding.Default;

Then you can use your keyboard € symbol... it works for me! ;)

Tags:

C#

Linq