-
Notifications
You must be signed in to change notification settings - Fork 284
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
How to prevent JSON unicode escaping #809
Comments
In fact I disabled Unicode output escaping for the std_data_json candidate. @etcimon, do you think that doing so would do any harm in practice, based on what you experienced so far? I would at least make it the default to pass Unicode as-is. For the |
Two ways to do it would be an |
I don't see why it would ever not be preferable. After all JSON is defined to be UTF encoded, so this just seems to be done for some kind of legacy support in existing libraries. I had hoped that the time of 7-bit bytes was over, though. Since this change was introduced recently without any preceding complaints, I'm leaning towards just disabling it for vibe.d and to keep it as an option in |
So it would be preferable to disable it by default if there is a simple legacy wrapper than outputs legacy ASCII from a UTF json string. After giving it some thought, I don't see any issue with sending UTF strings by default whereas being unable to decode UTF-8/UTF-16 from ASCII strings was obviously a necessity. |
Thanks a lot for fast response!
Although any browser understands escaped characters most of Russian websites are sent with plain UTF-8 (escaped char is 6 byte long and plain is only 2 bytes long). |
Hi, I've found that unicode strings are forced to be escaped in
toPrettyString
method (also at any json to string conversion), example:Is there is any way to control the behavior? It is getting hard to analyze response for huge JSONs (generally for frontend developers).
The text was updated successfully, but these errors were encountered: