Opened 9 years ago

Closed 5 years ago

#9360 closed Bugs (duplicate)

boost::format char->hex

Reported by: nen777w@… Owned by: Samuel Krempp
Milestone: To Be Determined Component: format
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc:

Description

long l = 0x11223344;
unsigned char c = 0x55;
std::string s = (boost::format("%04X - %01X") % l % c).str(); //<-- "11223344 - U" ???

char ccc[10] = {0};
sprintf(ccc, "%01x", c); //<-- "55" OK!

Change History (1)

comment:1 by James E. King, III, 5 years ago

Resolution: duplicate
Status: newclosed

Same issue as #4658: character input conversion to numeric seems to be broken, I will update 4658 with a unit test that shows this behavior.

Note: See TracTickets for help on using tickets.