diff --git a/src/string_codec.cpp b/src/string_codec.cpp index 5e48d214a..6e19c7fbb 100644 --- a/src/string_codec.cpp +++ b/src/string_codec.cpp @@ -45,7 +45,7 @@ std::string inline_string_encode(const std::string &input) { auto format = boost::format("#%02X"); for (char c : input) { if (c <= 0x1F || c == 0x23 || c == 0x2C || c == 0x3A || c == 0x7C) - output += str(format % c); + output += str(format % (int)(unsigned char)c); else output += c; }