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
toStyledString() produces \u escapes for UTF-8 characters such as ï.
This is caused by escaping on the ground that c > 0x7F in doesAnyCharRequireEscaping(), called from valueToQuotedStringN() from BuiltStyledStreamWriter::writeValue(). The last part of the condition imo should be removed;
After removing c > 0x7F, I get normal UTF-8 which I need and is imo in line with the specs.
The text was updated successfully, but these errors were encountered:
json_writer.cpp:180.
I commented out the original body of the lambda and replaced it with a shorter one, because UTF-8 was getting escaped.
This change is only useful in case of UTF-8 in the json text, and a desire to keep things that way,
so probably this should be done with more nuance than this.
Anyway, it helped in my specific case.
staticbooldoesAnyCharRequireEscaping(charconst* s, size_t n) {
assert(s || !n);
returnstd::any_of(s, s + n, [](unsignedchar c) {
//return c == '\\' || c == '"' || c < 0x20 || c > 0x7F; // c > 0x7F conflicts with UTF-8return c == '\\' || c == '"' || c < 0x20;
});
}
toStyledString() produces \u escapes for UTF-8 characters such as ï.
This is caused by escaping on the ground that c > 0x7F in doesAnyCharRequireEscaping(), called from valueToQuotedStringN() from BuiltStyledStreamWriter::writeValue(). The last part of the condition imo should be removed;
After removing c > 0x7F, I get normal UTF-8 which I need and is imo in line with the specs.
The text was updated successfully, but these errors were encountered: