forked from mia/Aegisub
Work around boost::format bug
See https://svn.boost.org/trac/boost/ticket/9360 It seems that the %X specifier is ignored if the input value is a char type and the char is instead output verbatim and not in its integer value. Casting it to an int works around this.
This commit is contained in:
parent
3f08b1d057
commit
b2768b7abd
1 changed files with 1 additions and 1 deletions
|
@ -45,7 +45,7 @@ std::string inline_string_encode(const std::string &input) {
|
||||||
auto format = boost::format("#%02X");
|
auto format = boost::format("#%02X");
|
||||||
for (char c : input) {
|
for (char c : input) {
|
||||||
if (c <= 0x1F || c == 0x23 || c == 0x2C || c == 0x3A || c == 0x7C)
|
if (c <= 0x1F || c == 0x23 || c == 0x2C || c == 0x3A || c == 0x7C)
|
||||||
output += str(format % c);
|
output += str(format % (int)(unsigned char)c);
|
||||||
else
|
else
|
||||||
output += c;
|
output += c;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue