Merge pull request #533 from Kronuz/patch-1

Save the flags of the stream
This commit is contained in:
Takatoshi Kondo 2016-10-29 13:28:10 +09:00 committed by GitHub
commit 2f34d22bf5

View File

@ -813,7 +813,9 @@ inline std::ostream& operator<< (std::ostream& s, const msgpack::object& o)
default: {
unsigned int code = static_cast<unsigned int>(c);
if (code < 0x20 || code == 0x7f) {
std::ios::fmtflags flags(s.flags());
s << "\\u" << std::hex << std::setw(4) << std::setfill('0') << (code & 0xff);
s.flags(flags);
}
else {
s << c;