Skip to content
Snippets Groups Projects
Commit a83da3a4 authored by Nat Goodspeed's avatar Nat Goodspeed
Browse files

DRTVWR-476: Make LLSDFormatter::OPTIONS_PRETTY_BINARY uppercase

for compatibility with Python llbase.llsd.parse().

The Python parse() currently requires uppercase hex digits for b16"hex"
coding; lowercase hex digits cause it to raise LLSDParseError.
parent 6e5242f0
No related branches found
No related tags found
No related merge requests found
...@@ -1423,6 +1423,10 @@ S32 LLSDNotationFormatter::format_impl(const LLSD& data, std::ostream& ostr, ...@@ -1423,6 +1423,10 @@ S32 LLSDNotationFormatter::format_impl(const LLSD& data, std::ostream& ostr,
{ {
std::ios_base::fmtflags old_flags = ostr.flags(); std::ios_base::fmtflags old_flags = ostr.flags();
ostr.setf( std::ios::hex, std::ios::basefield ); ostr.setf( std::ios::hex, std::ios::basefield );
// It shouldn't strictly matter whether the emitted hex digits
// are uppercase; LLSDNotationParser handles either; but as of
// 2020-05-13, Python's llbase.llsd requires uppercase hex.
ostr << std::uppercase;
auto oldfill(ostr.fill('0')); auto oldfill(ostr.fill('0'));
auto oldwidth(ostr.width()); auto oldwidth(ostr.width());
for (int i = 0; i < buffer.size(); i++) for (int i = 0; i < buffer.size(); i++)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment