Remove setlocale call in __hxcpp_stdlibs_boot #1284
+0
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 usingchcp 65001does 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. formattingwchar_t*string into achar*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 65001or equivalent to view utf-8 output correctly on windows, see: #842.