Fixed bugs in escape characters (both parsing and emitting)

This commit is contained in:
Jesse Beder
2009-09-07 16:31:23 +00:00
parent 45ac700fff
commit e3ff87ecde
3 changed files with 46 additions and 4 deletions

View File

@@ -83,7 +83,7 @@ namespace YAML
} else {
// TODO: for the common escaped characters, give their usual symbol
std::stringstream str;
str << "\\x" << std::hex << std::setfill('0') << std::setw(2) << static_cast <int>(ch);
str << "\\x" << std::hex << std::setfill('0') << std::setw(2) << static_cast<unsigned int>(static_cast<unsigned char>(ch));
out << str.str();
}
}