digitalmars.D.learn - Print a copyright symbol
- Head Scratcher (4/4) Jan 11 2019 How would I use writeln to print a copyright symbol to the
- Adam D. Ruppe (12/16) Jan 11 2019 You need to be using a system that supports the output.
How would I use writeln to print a copyright symbol to the console? I have tried using the unicode code \u00A9, as well as embedding the symbol directly in the string, but I just get garbage when I run it.
Jan 11 2019
On Friday, 11 January 2019 at 16:48:40 UTC, Head Scratcher wrote:How would I use writeln to print a copyright symbol to the console? I have tried using the unicode code \u00A9, as well as embedding the symbol directly in the string, but I just get garbage when I run it.You need to be using a system that supports the output. On Windows, it means changing the console mode to utf-8 so it understands the bytes when it sees them. import core.sys.windows.windows; SetConsoleOutputCP(65001); // UTF-8 before you do some writeln and it should work on windows 10. On older systems, you might have to go into console properties and select a truetype font too. (or as the user btw you can go into console properties and change the code page there, but I think it is slightly easier to do it on code)
Jan 11 2019