Console.Write () - display extended ascii characters?

I can correctly display standard ASCII characters (up to 127), such as "heart", "notice", you know what I mean. I would also like to display the ones that I can use to paint walls (like U0205), but that doesn't work. Well, it works, but it looks like a “?”. How can I display them? Thank.

+2
source share
2 answers

Console applications are limited to 8-bit codepage encoding. By default, many machines use IBM437, the code page for the old IBM PC character set. You can change the code page by setting the OutputEncoding property:

        Console.OutputEncoding = Encoding.UTF8;

. "", IBM PC. , , Unicode. , Vista Win7.

, , , , . - , . , :

class Program {
    static void Main(string[] args) {
        Console.WriteLine("╒════════╕");
        Console.WriteLine("│ Hello  │");
        Console.WriteLine("│ world  │");
        Console.WriteLine("╘════════╛");
        Console.ReadLine();
    }
}

, Windows charmap.exe. " " "" "", . , , "\ u250c".

+16

, . windows (cmd.exe), , Unicode - , cmd.exe:

Fußball Ö ü

PowerShell, , .

/ " " , .

+1

All Articles