digitalmars.D.learn - How do I display unicode characters in D on standard (english) Windows
- WhatMeWorry (9/9) Jul 29 2019 This is a very stupid question but from Ali's book, I took this
- kinke (4/5) Jul 29 2019 Switching the console code page to UTF-8, and then restoring the
- Martin Krejcirik (6/9) Jul 30 2019 Just be advised, this was seriously broken in the past. Depends
- kinke (2/6) Jul 30 2019 stderr was fixed with Win10 v1809.
- Carl Sturtivant (9/18) Jul 31 2019 In my Windows 10 build 1803 I was able to find a box to check to
This is a very stupid question but from Ali's book, I took this segment: writeln("Résumé preparation: 10.25€"); writeln("\x52\ésum\u00e9 preparation: 10.25\€"); and after running it all I get is the following: R├⌐sum├⌐ preparation: 10.25Γé¼ R├⌐sum├⌐ preparation: 10.25Γé¼ I was expecting the symbol "£" or something like that. What am I missing?
Jul 29 2019
On Monday, 29 July 2019 at 22:17:55 UTC, WhatMeWorry wrote:What am I missing?Switching the console code page to UTF-8, and then restoring the original one before termination. See https://github.com/ldc-developers/ldc/pull/3086/commits/5915534530fa095e7e5d58bcfb4ad100d249bbca#diff-c59e7716a40a0 ce42f141c738f2c311. You may have to set a non-raster console font (e.g., Consolas).
Jul 29 2019
On Monday, 29 July 2019 at 22:31:01 UTC, kinke wrote:Switching the console code page to UTF-8, and then restoring the original one before termination. See https://github.com/ldc-developers/ldc/pull/3086/commits/5915534530fa095e7e5d58bcfb4ad100d249bbca#diff-c59e7716a40a0 ce42f141c738f2c311. You may have to set a non-raster console font (e.g., Consolas).Just be advised, this was seriously broken in the past. Depends on windows, ms libraries, whether it's stdout or stderr and more. Current versions are probably ok, will check. Don't count on this to work on older windows including older Win10. I always convert to/from console codepage to be safe.
Jul 30 2019
On Tuesday, 30 July 2019 at 12:06:23 UTC, Martin Krejcirik wrote:Just be advised, this was seriously broken in the past. Depends on windows, ms libraries, whether it's stdout or stderr and more. Current versions are probably ok, will check. Don't count on this to work on older windows including older Win10.stderr was fixed with Win10 v1809.
Jul 30 2019
On Monday, 29 July 2019 at 22:17:55 UTC, WhatMeWorry wrote:This is a very stupid question but from Ali's book, I took this segment: writeln("Résumé preparation: 10.25€"); writeln("\x52\ésum\u00e9 preparation: 10.25\€"); and after running it all I get is the following: R├⌐sum├⌐ preparation: 10.25Γé¼ R├⌐sum├⌐ preparation: 10.25Γé¼ I was expecting the symbol "£" or something like that. What am I missing?In my Windows 10 build 1803 I was able to find a box to check to globally use the UTF-8 code page. Checking it requires a restart as it says the locale has changed. Settings>Time&Language>Region&Language>Administrative_Language_Settings brings up a Region dialog, and clicking on "Change system locale..." brought up a dialog where this box can be checked. After doing this the console acted sensibly right away with the code you wrote.
Jul 31 2019