summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/binary-writer-spec.cc2
-rw-r--r--src/stream.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/binary-writer-spec.cc b/src/binary-writer-spec.cc
index ded6fa2f..002162ce 100644
--- a/src/binary-writer-spec.cc
+++ b/src/binary-writer-spec.cc
@@ -110,7 +110,7 @@ void BinaryWriterSpec::WriteEscapedString(string_view s) {
json_stream_->WriteChar('"');
for (size_t i = 0; i < s.length(); ++i) {
uint8_t c = s[i];
- if (c < 0x20 || c == '\\' || c == '"' || c > 0x7f) {
+ if (c < 0x20 || c == '\\' || c == '"') {
json_stream_->Writef("\\u%04x", c);
} else {
json_stream_->WriteChar(c);
diff --git a/src/stream.h b/src/stream.h
index 87cae087..aab7be57 100644
--- a/src/stream.h
+++ b/src/stream.h
@@ -106,7 +106,7 @@ class Stream {
void WriteChar(char c,
const char* desc = nullptr,
PrintChars print_chars = PrintChars::No) {
- WriteU8(c, desc, print_chars);
+ WriteU8(static_cast<unsigned char>(c), desc, print_chars);
}
// Dump memory as text, similar to the xxd format.