mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-14 23:07:58 +02:00
Merge pull request #533 from Kronuz/patch-1
Save the flags of the stream
This commit is contained in:
@@ -813,7 +813,9 @@ inline std::ostream& operator<< (std::ostream& s, const msgpack::object& o)
|
|||||||
default: {
|
default: {
|
||||||
unsigned int code = static_cast<unsigned int>(c);
|
unsigned int code = static_cast<unsigned int>(c);
|
||||||
if (code < 0x20 || code == 0x7f) {
|
if (code < 0x20 || code == 0x7f) {
|
||||||
|
std::ios::fmtflags flags(s.flags());
|
||||||
s << "\\u" << std::hex << std::setw(4) << std::setfill('0') << (code & 0xff);
|
s << "\\u" << std::hex << std::setw(4) << std::setfill('0') << (code & 0xff);
|
||||||
|
s.flags(flags);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
s << c;
|
s << c;
|
||||||
|
Reference in New Issue
Block a user