Commit b58a93b8 authored by Niels's avatar Niels
Browse files

merged #111

parent 6f2da1a3
......@@ -373,6 +373,7 @@ I deeply appreciate the help of the following people.
- [易思龙](https://github.com/likebeta) implemented a conversion from anonymous enums.
- [kepkin](https://github.com/kepkin) patiently pushed forward the support for Microsoft Visual studio.
- [gregmarr](https://github.com/gregmarr) simplified the implementation of reverse iterators.
- [Caio Luppi](https://github.com/caiovlp) fixed a bug in the Unicode handling.
Thanks a lot for helping out!
......
......@@ -4692,6 +4692,8 @@ class basic_json
// print character c as \uxxxx
sprintf(&result[pos + 1], "u%04x", int(c));
pos += 6;
// overwrite trailing null character
result[pos] = '\\';
}
else
{
......
......@@ -4692,6 +4692,8 @@ class basic_json
// print character c as \uxxxx
sprintf(&result[pos + 1], "u%04x", int(c));
pos += 6;
// overwrite trailing null character
result[pos] = '\\';
}
else
{
......
......@@ -10194,4 +10194,12 @@ TEST_CASE("regression tests")
// hexadecimal "a"
CHECK(j.dump() == "{\"binary string\":\"\\u0000asdf\\n\",\"int64\":10}");
}
SECTION("issue #111 - subsequent unicode chars")
{
std::string bytes{0x7, 0x7};
json j;
j["string"] = bytes;
CHECK(j["string"] == "\u0007\u0007");
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment