Skip to content

Commit

Permalink
fix utf8 escape
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzziqersoftware committed Sep 8, 2024
1 parent 7517358 commit 806a214
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Strings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ string escape_controls(const string& s, bool escape_non_ascii) {
ret += "\\a";
} else if (ch == '\v') {
ret += "\\v";
} else if (ch < 0x20 || (ch > 0x7E && escape_non_ascii)) {
} else if (escape_non_ascii ? (ch < 0x20 || ch > 0x7E) : ((ch < 0x20 && ch >= 0x00) || ch == 0x7F)) {
ret += string_printf("\\x%02X", static_cast<uint8_t>(ch));
} else {
ret += ch;
Expand Down

0 comments on commit 806a214

Please sign in to comment.