found a minor issue encoding \177 a.k.a. \u007F, that was encoded in lowercase

JSON-80
Lars Rohwedder 5 years ago
parent 638b5804c4
commit 2e1007cfc7

@ -63,7 +63,7 @@ namespace json_spirit
case '\n': s += to_str< String_type >( "\\n" ); return true;
case '\r': s += to_str< String_type >( "\\r" ); return true;
case '\t': s += to_str< String_type >( "\\t" ); return true;
case '\177': s += to_str< String_type >( "\\u007f" ); return true;
case '\177': s += to_str< String_type >( "\\u007F" ); return true;
}
// _always_ convert all remaining ASCII control characters into \uXXXX form:

@ -24,7 +24,7 @@ const std::vector<TestTriple> testValues =
{
{ "" , R"("")" , R"("")" }, // always start with the simple case ;-)
{ "123" , R"("123")" , R"("123")" }, // some ASCII digits. Still easy.
{ "\n\\\b", R"("\n\\b")" , R"("\n\\b")" }, // backslash escapes for ASCII and control chars
{ "\n\\\b", R"("\n\\\b")" , R"("\n\\\b")" }, // backslash escapes for ASCII and control chars
{ "\x1f" , R"("\u001F")" , R"("\u001F")" }, // C compiler knows \x##, but JSON does not
{ "\x7f" , R"("\u007F")" , R"("\u007F")" }, // C compiler knows \x##, but JSON does not
{ "äöü" , R"("\u00E4\u00F6\u00FC")" , R"("äöü")" },

Loading…
Cancel
Save