Thread overview
String characters not extended
Jan 02, 2017
Ignacious
Jan 02, 2017
Nicholas Wilson
Jan 03, 2017
bauss
Jan 03, 2017
Anonymouse
Jan 03, 2017
Daniel Kozák
Jan 04, 2017
Anonymouse
January 02, 2017
when one prints out a string with some extended(I guess it's unicode), writeln prints out the ascii versions that do not correspond to what they really are. e.g., an umlaut is printed out as 1/2 or something.

how to get it to print the correct codes?
January 02, 2017
On Monday, 2 January 2017 at 21:07:37 UTC, Ignacious wrote:
> when one prints out a string with some extended(I guess it's unicode), writeln prints out the ascii versions that do not correspond to what they really are. e.g., an umlaut is printed out as 1/2 or something.
>
> how to get it to print the correct codes?

It should Just work. can you paste the source and output?


January 03, 2017
On Monday, 2 January 2017 at 21:07:37 UTC, Ignacious wrote:
> when one prints out a string with some extended(I guess it's unicode), writeln prints out the ascii versions that do not correspond to what they really are. e.g., an umlaut is printed out as 1/2 or something.
>
> how to get it to print the correct codes?

Most likely not an issue with D, but your console's display encoding. Else your standard output might have ASCII as encoding and then you'd have to change it.

What OS are you on?
January 03, 2017
On Monday, 2 January 2017 at 21:07:37 UTC, Ignacious wrote:
> [...]

Assuming Windows:

version(Windows)
shared static this()
{
    import core.sys.windows.windows;
    SetConsoleCP(65001);
    SetConsoleOutputCP(65001);
}
January 03, 2017
Anonymouse via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> napsal Út, led 3, 2017 v 12∶34 :
> On Monday, 2 January 2017 at 21:07:37 UTC, Ignacious wrote:
>> [...]
> 
> Assuming Windows:
> 
> version(Windows)
> shared static this()
> {
>     import core.sys.windows.windows;
>     SetConsoleCP(65001);
>     SetConsoleOutputCP(65001);
> }

Why do not use CP_UTF8 constant instead of 65001? It is safer, easier to read and understand


January 04, 2017
On Tuesday, 3 January 2017 at 19:40:20 UTC, Daniel Kozák wrote:
> Why do not use CP_UTF8 constant instead of 65001? It is safer, easier to read and understand

I have no reason to back it up with. I'm literally just copy/pasting what others have suggested I use.