Search code examples
c#windows

Cannot print special characters to console


When I try to output "ᕦ( ͡° ͜ʖ ͡°)ᕤ" to console it's just a bunch of question marks.

I have tried messing with System.Console.OutputEncoding with no success.

How can I achieve my utmost important goal of printing the "ᕦ( ͡° ͜ʖ ͡°)ᕤ".


Solution

  • This works reasonably well (as in: the shape is more recognizable):

    Console.OutputEncoding = Encoding.Unicode;
    Console.WriteLine("ᕦ( ͡° ͜ʖ ͡°)ᕤ");
    Console.ReadLine();
    

    But you need to change the console's default font to something like consolas. With font changed to Consolas it looks like:

    Screenshot / proof

    With the default font it looks like:

    Screenshot / proof

    And if you change the font but don't set the output encoding it looks like:

    Screenshot / proof

    The console's default encoding is OEM Multilingual Latin 1; Western European (DOS) e.g. "IBM850" or OEM United States e.g. "IBM437".

    However, as suggested in other comments: don't. Just don't. Here's why.