digitalmars.D.learn - How to correctly display accented characters at the Windows prompt?
- Cleverson Casarin Uliana via Digitalmars-d-learn (8/8) Oct 10 2016 Hello, when I run a compiled Windows executable at the console,
- John C (3/12) Oct 10 2016 Call SetConsoleOutputCP(CP_UTF8).
- Cleverson Casarin Uliana via Digitalmars-d-learn (7/7) Oct 10 2016 Hello John and all, how do you search for a given function to see
- Jonathan M Davis via Digitalmars-d-learn (5/10) Oct 10 2016 It looks like it's in
- Martin Krejcirik (2/5) Oct 10 2016 No, this may appear to to work, but in reality, it's broken. The
- Cleverson Casarin Uliana via Digitalmars-d-learn (9/9) Oct 10 2016 Hi Martin, indeed, here in my workplace Windows machine there is no
- Martin Krejcirik (15/20) Oct 10 2016 codepage 65001 (UTF8) should be available on all modern Windows.
- Martin Krejcirik (1/2) Oct 10 2016 chcp 65001
Hello, when I run a compiled Windows executable at the console, letters outside the ascii range such as ç and ã do not display propperly. Is there any d function to change the console code page on the fly? My Windows console code page, which is for Brazilian Portuguese, is at 850. Perhaps an alternative would be to convert d strings from Unicode to the 850 code page on the fly. Thanks, Cleverson
Oct 10 2016
On Monday, 10 October 2016 at 14:14:08 UTC, Cleverson Casarin Uliana wrote:Hello, when I run a compiled Windows executable at the console, letters outside the ascii range such as ç and ã do not display propperly. Is there any d function to change the console code page on the fly? My Windows console code page, which is for Brazilian Portuguese, is at 850. Perhaps an alternative would be to convert d strings from Unicode to the 850 code page on the fly. Thanks, CleversonCall SetConsoleOutputCP(CP_UTF8).
Oct 10 2016
Hello John and all, how do you search for a given function to see where it is defined/declared? I tried to find SetConsoleOutputCP by myself, but the search embeded in the documentation cannot find anything in the phobos library refference, and searching the entire site returns forum posts only. Thanks, Cleverson
Oct 10 2016
On Monday, October 10, 2016 13:24:09 Cleverson Casarin Uliana via Digitalmars- d-learn wrote:Hello John and all, how do you search for a given function to see where it is defined/declared? I tried to find SetConsoleOutputCP by myself, but the search embeded in the documentation cannot find anything in the phobos library refference, and searching the entire site returns forum posts only.It looks like it's in core.sys.windows.wincon; - Jonathan M Davis
Oct 10 2016
No, this may appear to to work, but in reality, it's broken. The only reliable way is to convert to the native windows codepage.Thanks, CleversonCall SetConsoleOutputCP(CP_UTF8).
Oct 10 2016
Hi Martin, indeed, here in my workplace Windows machine there is no "CP_UTF_8" codepage, nor there is 65001. I was waiting to try it later on my home machine, but since you say it's broken, then I'll need to look for a way to convert the actual string to the 850 codepage... Just for info, this is probably a d related bug, because the Racket language for example has a (reencode-output-port) function, and it Works. Greetings, Cleverson
Oct 10 2016
On Monday, 10 October 2016 at 19:31:14 UTC, Cleverson Casarin Uliana wrote:Hi Martin, indeed, here in my workplace Windows machine there is no "CP_UTF_8" codepage, nor there is 65001. I was waiting tocodepage 65001 (UTF8) should be available on all modern Windows. You can try command cp 65001 in the console window (and change your font accordingly).Just for info, this is probably a d related bug, because the Racket language for example has a (reencode-output-port) function, and it Works.I don't know know about Racket, but D's problems are related to the C runtime library. Here is what I found out: -m32 (uses DM C library): output to stdout works, but stderr is broken (corrupt accented characters, or total output freeze). https://issues.dlang.org/show_bug.cgi?id=1448 -m32mscoff and -m64 (Microsoft C runtime): broken characters and some mysterious failures. https://issues.dlang.org/show_bug.cgi?id=15761 So this leaves transcoding as the only viable solution. Luckily, there is std.windows.charset.toMBSz function you can use.
Oct 10 2016
Windows. You can try command cp 65001 in the console windowchcp 65001
Oct 10 2016