mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-05-27 15:10:04 +02:00
Merge pull request #533 from Kronuz/patch-1
Save the flags of the stream
This commit is contained in:
commit
2f34d22bf5
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user