Skip to content

Commit

Permalink
Fix json output
Browse files Browse the repository at this point in the history
Use " instead of ' for strings.

Fix #278
  • Loading branch information
mgautierfr committed Jan 13, 2022
1 parent d8279fd commit 6515568
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 114 deletions.
6 changes: 3 additions & 3 deletions src/zimcheck/json_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ void OutputStream::output(const char* s)
assert(!m_nesting.empty());
m_nesting.top().hasData = true;
auto& out = *m_out;
out << '\'';
out << '\"';
for (const char* p = s; *p; ++p) {
if (*p == '\'' || *p == '\\') {
if (*p == '\"' || *p == '\\') {
out << '\\' << *p;
} else if ( *p == '\n' ) {
out << "\\n";
} else {
out << *p;
}
}
out << '\'';
out << '\"';
}

void OutputStream::output(StartObject)
Expand Down
Loading

0 comments on commit 6515568

Please sign in to comment.