Revision ff06ea21
b/qjson.c | ||
---|---|---|
163 | 163 |
qstring_append(str, "\\t"); |
164 | 164 |
break; |
165 | 165 |
default: { |
166 |
char buf[2] = { ptr[0], 0 }; |
|
167 |
qstring_append(str, buf); |
|
166 |
if (ptr[0] <= 0x1F) { |
|
167 |
char escape[7]; |
|
168 |
snprintf(escape, sizeof(escape), "\\u%04X", ptr[0]); |
|
169 |
qstring_append(str, escape); |
|
170 |
} else { |
|
171 |
char buf[2] = { ptr[0], 0 }; |
|
172 |
qstring_append(str, buf); |
|
173 |
} |
|
168 | 174 |
break; |
169 | 175 |
} |
170 | 176 |
} |
Also available in: Unified diff