mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-23 16:48:06 +02:00
added '/' to the characters escaped in JSON
This commit is contained in:
@@ -70,9 +70,13 @@ void Stringifier::stringify(const Var& any, std::ostream& out, unsigned int inde
|
||||
void Stringifier::formatString(const std::string& value, std::ostream& out)
|
||||
{
|
||||
out << '"';
|
||||
for (std::string::const_iterator it = value.begin(); it != value.end(); ++it)
|
||||
for (std::string::const_iterator it = value.begin(),
|
||||
end = value.end(); it != end; ++it)
|
||||
{
|
||||
if (*it <= 0x1F || *it == '"' || *it == '\\') out << '\\';
|
||||
if (*it <= 0x1F || *it == '"' || *it == '\\' || *it == '/')
|
||||
{
|
||||
out << '\\';
|
||||
}
|
||||
out << *it;
|
||||
}
|
||||
out << '"';
|
||||
|
Reference in New Issue
Block a user