-1

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.

Mickey
  • 943
  • 1
  • 19
  • 41

2 Answers2

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
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