You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Binary string causes numbers to be dumped as hex #101
The following code dumps the value of the number field in hexadecimal format (without leading 0x, but that's not legal json anyway afaik) when there's also a string containing a symbol between \x00 and \x1f.
I can reproduce the error. I have no idea yet why the dump() function decides to print the number as hex, but the library seems to be confused by the control character inside the string. I'll continue checking.
I found the reason for the problem: The control characters need to be escaped as \uxxxx. In that part of the code, an internal string stream is configured to print the character as hexadecimal number. This needs to be reset, because otherwise all subsequent numbers would be printed as hexadecimal (a instead of 10).
Activity
nlohmann commentedon Jul 1, 2015
I can reproduce the error. I have no idea yet why the
dump()function decides to print the number as hex, but the library seems to be confused by the control character inside the string. I'll continue checking.nlohmann commentedon Jul 1, 2015
I found the reason for the problem: The control characters need to be escaped as
\uxxxx. In that part of the code, an internal string stream is configured to print the character as hexadecimal number. This needs to be reset, because otherwise all subsequent numbers would be printed as hexadecimal (ainstead of10).Review round 2 (nlohmann#92)
Review round 2 (nlohmann#92)