Boost C++ Libraries: Ticket #9360: boost::format char->hex https://svn.boost.org/trac10/ticket/9360 <pre class="wiki">long l = 0x11223344; unsigned char c = 0x55; std::string s = (boost::format("%04X - %01X") % l % c).str(); //&lt;-- "11223344 - U" ??? char ccc[10] = {0}; sprintf(ccc, "%01x", c); //&lt;-- "55" OK! </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9360 Trac 1.4.3 James E. King, III Thu, 12 Oct 2017 17:56:58 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9360#comment:1 https://svn.boost.org/trac10/ticket/9360#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">duplicate</span> </li> </ul> <p> Same issue as <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4658" title="#4658: Bugs: (boost::format(&#34;%u&#34;) % (unsigned char)2).str(); error result (closed: wontfix)">#4658</a>: character input conversion to numeric seems to be broken, I will update 4658 with a unit test that shows this behavior. </p> Ticket