I tried to print this character ’
using Console.WriteLine((char) 146);
but it printed ?
. When I set Console.OutputEncoding = System.Text.Encoding.UTF8
it printed some glitched characters, not the one I needed.
Asked
Active
Viewed 1,104 times
-1

Mickey
- 943
- 1
- 19
- 41

user2886646
- 61
- 7
-
You probably can't change the console encoding programmatically that way. The Windows console is generally useless for Unicode. – millimoose Oct 16 '13 at 13:50
-
1And what do you expect to be printed? – Steve Oct 16 '13 at 13:52
-
Have you considered changing your console font to one that has a glyph for that character? – Kris Vandermotten Oct 16 '13 at 13:54
-
@user2886646 does my solution work for you now, as still it is not signed as answered? – Tafari Oct 16 '13 at 21:18
-
Guess it works, but for some reason you are not going to mark it as answered... – Tafari Oct 17 '13 at 21:47
2 Answers
0
The code you need is 8217.
But you also have to enable UTF8 encoding and change font, to the one which can display UTF8 characters:
Console.OutputEncoding = Encoding.UTF8;
int value = '’';
Console.WriteLine((char)value);
Console.ReadLine();
And if your current console font doesnt support this character you may also have to change it.
How? After you launch the console right-click on the title bar -> properties -> fonts -> Lucida Console
And voila it works!

Tafari
- 2,639
- 4
- 20
- 28
-
-
-
-
I can get $ with (char)36 too, but still I get "?" when trying to print (char)146 – user2886646 Oct 16 '13 at 14:03
-
-
1
-
-
@user2886646 use my code and change the console font it will work for value 8217. – Tafari Oct 16 '13 at 17:30
0
Have you tried this?
static void Main(string[] args)
{
Console.WriteLine((char)39);
}
At least this works for me.

Mickey
- 943
- 1
- 19
- 41
-
It doesn't change if I add Console.OutputEncoding = Encoding.UTF8; before. – Mickey Oct 16 '13 at 16:02
-
Are you sure it prints `acute accent (’)` not an `apostrophe (')`? As probably you mix them up. – Tafari Oct 16 '13 at 17:29
-