Skip to content

Commit 2f34d22

Browse files
authored
Merge pull request #533 from Kronuz/patch-1
Save the flags of the stream
2 parents 401460b + 03b770f commit 2f34d22

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/msgpack/v1/object.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,9 @@ inline std::ostream& operator<< (std::ostream& s, const msgpack::object& o)
813813
default: {
814814
unsigned int code = static_cast<unsigned int>(c);
815815
if (code < 0x20 || code == 0x7f) {
816+
std::ios::fmtflags flags(s.flags());
816817
s << "\\u" << std::hex << std::setw(4) << std::setfill('0') << (code & 0xff);
818+
s.flags(flags);
817819
}
818820
else {
819821
s << c;

0 commit comments

Comments
 (0)