Skip to content

Conversation

@tobil4sk
Copy link
Member

On Windows, this meant the utf-8 string passed to printf("%s") was interpreted as if it is from the default system locale encoding instead of utf-8, which are incompatible so any non-ASCII text comes out garbled. This setlocale call also meant that using chcp 65001 does not have the correct effect of being able to view the full range of utf-8 characters from print output.

Originally, this setlocale call was required due to the use of print("%S") (i.e. formatting wchar_t* string into a char* in 94812c3 and 88f2474), but the printing functions in Stdlibs.cpp no longer rely on that (since 54fb7a1) so it is safe to remove.

This way, it is possible to use chcp 65001 or equivalent to view utf-8 output correctly on windows, see: #842.

On Windows, this meant the utf-8 string passed to printf("%s") was
interpreted as if it is from the default system locale encoding instead
of utf-8, which are incompatible so any non-ASCII text comes out
garbled. This setlocale call also meant that using `chcp 65001` does not
haxe the correct effect of being able to view the full range of utf-8
characters from print output.

Originally, this setlocale call was required required due to the use of
print("%S"), but the printing functions in Stdlibs.cpp no longer rely on
that so it is safe to remove.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant