'How to decode unicode characters when using ReadAllText?
Right now I'm trying to add ASCII art to my console project using these symbols:
┌─┬┐ ╔═╦╗ ╓─╥╖ ╒═╤╕
│░││ ║▒║║ ║▓║║ │ ││
├─┼┤ ╠═╬╣ ╟─╫╢ ╞═╪╡
└─┴┘ ╚═╩╝ ╙─╨╜ ╘═╧╛
▐ ▌ ▄ ▀ █
To extract images from a text file, I use a command like
Console.WriteLine(File.ReadAllText(@"C:\Users\ME\source\repos\sum\sum\ASCIIlj2.txt"));
but instead of the desired image, I get something like this:
I'm using windows 7 and VS 2019 if that matters. How can I print these characters to the console in the way I need?
UPD: In this case, if I insert characters into the code, the code directly (like this)
Console.WriteLine("┌─┬┐ ╔═╦╗ ╓─╥╖");
Everything is displayed correctly.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|