-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
if json file contain Internationalization chars , get exception #1122
Comments
Please make sure that your code is compiled with UTF-8, assuming you use MSVC. |
For note, this is not entirely valid in source code. The C++ spec only ensures that the ascii range is viable source code, anything beyond that is up to the compiler (and though most compilers will support it, you have to add the proper argument to most compilers to tell it to). In general, keep to the ascii range in C++ source, keep UTF-8 and so forth out in other files that load up. |
Tested under Linux, everything is fine with utf-8. Under win10 MSVS, my system uses GBK encoding. Converting the json file to utf8 format by hand , reading does not throw an exception, but the out data is encoded with utf8. It cannot be displayed correctly in the terminal.
|
Nothing to do with the OS, everything to do with the compiler and the options for it. As for the terminal, sounds like a new terminal is needed, windows does not have great methods for detecting terminal capabilities unlike linux, but even then that is all user-code stuff, not json. ^.^ |
这个临时解决了我的问题^^ |
exception at
j2 << ifs;
The text was updated successfully, but these errors were encountered: