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.
meow-7.2.2
Nat Goodspeed 2020-05-14 08:54:15 -04:00
parent 6e5242f0a4
commit a83da3a452
1 changed files with 4 additions and 0 deletions

View File

@ -1423,6 +1423,10 @@ S32 LLSDNotationFormatter::format_impl(const LLSD& data, std::ostream& ostr,
{
std::ios_base::fmtflags old_flags = ostr.flags();
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 oldwidth(ostr.width());
for (int i = 0; i < buffer.size(); i++)