We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 71802c3 commit a056840Copy full SHA for a056840
src/json_utils.cc
@@ -5,11 +5,11 @@ namespace node {
5
std::string EscapeJsonChars(const std::string& str) {
6
const std::string control_symbols[0x20] = {
7
"\\u0000", "\\u0001", "\\u0002", "\\u0003", "\\u0004", "\\u0005",
8
- "\\u0006", "\\u0007", "\\b", "\\t", "\\n", "\\v", "\\f", "\\r",
9
- "\\u000e", "\\u000f", "\\u0010", "\\u0011", "\\u0012", "\\u0013",
10
- "\\u0014", "\\u0015", "\\u0016", "\\u0017", "\\u0018", "\\u0019",
11
- "\\u001a", "\\u001b", "\\u001c", "\\u001d", "\\u001e", "\\u001f"
12
- };
+ "\\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"};
13
14
std::string ret;
15
size_t last_pos = 0;
test/cctest/test_json_utils.cc
@@ -12,11 +12,11 @@ TEST(JSONUtilsTest, EscapeJsonChars) {
const std::string expected[0x20] = {
16
17
18
19
20
for (int i = 0; i < 0x20; ++i) {
21
char symbols[1] = { static_cast<char>(i) };
22
std::string input(symbols, 1);
0 commit comments