Skip to content

Commit

Permalink
src: fix json utils escapes for U+000B
Browse files Browse the repository at this point in the history
  • Loading branch information
legendecas committed May 25, 2022
1 parent 30cb1bf commit 16001ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/json_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace node {
std::string EscapeJsonChars(const std::string& str) {
const std::string control_symbols[0x20] = {
"\\u0000", "\\u0001", "\\u0002", "\\u0003", "\\u0004", "\\u0005",
"\\u0006", "\\u0007", "\\b", "\\t", "\\n", "\\v", "\\f", "\\r",
"\\u0006", "\\u0007", "\\b", "\\t", "\\n", "\\u000B", "\\f", "\\r",
"\\u000e", "\\u000f", "\\u0010", "\\u0011", "\\u0012", "\\u0013",
"\\u0014", "\\u0015", "\\u0016", "\\u0017", "\\u0018", "\\u0019",
"\\u001a", "\\u001b", "\\u001c", "\\u001d", "\\u001e", "\\u001f"
Expand Down
2 changes: 1 addition & 1 deletion test/cctest/test_json_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ TEST(JSONUtilsTest, EscapeJsonChars) {

const std::string expected[0x20] = {
"\\u0000", "\\u0001", "\\u0002", "\\u0003", "\\u0004", "\\u0005",
"\\u0006", "\\u0007", "\\b", "\\t", "\\n", "\\v", "\\f", "\\r",
"\\u0006", "\\u0007", "\\b", "\\t", "\\n", "\\u000B", "\\f", "\\r",
"\\u000e", "\\u000f", "\\u0010", "\\u0011", "\\u0012", "\\u0013",
"\\u0014", "\\u0015", "\\u0016", "\\u0017", "\\u0018", "\\u0019",
"\\u001a", "\\u001b", "\\u001c", "\\u001d", "\\u001e", "\\u001f"
Expand Down

0 comments on commit 16001ae

Please sign in to comment.