diff options
Diffstat (limited to 'src/wasm.h')
-rw-r--r-- | src/wasm.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/wasm.h b/src/wasm.h index d53c4e629..3f3b7c271 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -1045,8 +1045,13 @@ public: case '\f': o << "\\f"; break; case '\b': o << "\\b"; break; case '\\': o << "\\\\"; break; - case 0: o << "\\0"; break; - default: o << c; // TODO: escaping + default: { + if (c >= 32 && c < 127) { + o << c; + } else { + o << std::hex << '\\' << (c/16) << (c%16) << std::dec; + } + } } } o << "\")"; |