You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to be able to dump JSON containing multibyte characters.
My std::string contains 3 characters (or glyphs) in UTF-8: Año.
In UTF-8, 'ñ' is represented as two bytes: \xC3 \xB1.
So, my string contains 4 bytes: [\x41, \xC3, \xB1, \x6F]
The problem appears when I get the dump of the JSON containing the mentioned string. It seems that the library dumps each byte as a character in Latin1: "{"text": "Año"}"
I'm expecting the following string in the dump: "{"text": "A\u00f1o"}"
But I read in other issues of the library that it assumes all strings are UTF-8. Shouldn't this mean that it must be able to know that the "\xC3 \xB1" bytes represent a single character? Am I missing something here?
I always code in Linux + Emacs + GCC, but in this project I need to use Visual Studio 2017.
The text was updated successfully, but these errors were encountered:
I want to be able to dump JSON containing multibyte characters.
My std::string contains 3 characters (or glyphs) in UTF-8: Año.
In UTF-8, 'ñ' is represented as two bytes: \xC3 \xB1.
So, my string contains 4 bytes: [\x41, \xC3, \xB1, \x6F]
The problem appears when I get the dump of the JSON containing the mentioned string. It seems that the library dumps each byte as a character in Latin1: "{"text": "Año"}"
I'm expecting the following string in the dump: "{"text": "A\u00f1o"}"
But I read in other issues of the library that it assumes all strings are UTF-8. Shouldn't this mean that it must be able to know that the "\xC3 \xB1" bytes represent a single character? Am I missing something here?
I always code in Linux + Emacs + GCC, but in this project I need to use Visual Studio 2017.
The text was updated successfully, but these errors were encountered: