Boost C++ Libraries: Ticket #11953: Boost 1.60: boost::archive::iterators bug? https://svn.boost.org/trac10/ticket/11953 <p> Hi, Recently I've noticed that Base64 encoded data produced by implementation I use and implementation used by chromium project sometimes are not the same. It happened only once but it was enough for me to start worrying. The implementation is quite simple. <br /> namespace bai = boost::archive::iterators; <br /> using it_base64_t = bai::base64_from_binary&lt;bai::transform_width&lt;std::string::const_iterator, 6, 8&gt;&gt;; <br /> auto writePaddChars = (3 - input.length() % 3) % 3; <br /> std::string base64(it_base64_t(input.begin()), it_base64_t(input.end())); <br /> base64.append(writePaddChars, '='); </p> <p> simple and elegant.<br /> </p> <p> However, today I wrote a short test which takes a chapter from 'Alice's Adventures in Wonderland' and encodes it. As well, I used two different online encoder to encode the same text, both online encoders produce the same data. However above code produced the same code until character 1029 and then it is different from what it should be. Then later, it gets back to the same output as produced by online encoders. So my question is, any chance it is a bug in archive::iterators or it is something in the above code? Coliru is down, so, full code is here <a class="ext-link" href="http://pastebin.com/JxMsMeV2"><span class="icon">​</span>http://pastebin.com/JxMsMeV2</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11953 Trac 1.4.3 Robert Ramey Sat, 12 Mar 2016 18:37:01 GMT <link>https://svn.boost.org/trac10/ticket/11953#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11953#comment:1</guid> <description> <p> Hmmm - very interesting. What are the two different characters. What is the global local setting during the two tests? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sat, 12 Mar 2016 19:50:41 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/11953 https://svn.boost.org/trac10/ticket/11953 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">B64EncodingSamples.7z</span> </li> </ul> Ticket kreuzerkrieg Sat, 12 Mar 2016 19:53:54 GMT <link>https://svn.boost.org/trac10/ticket/11953#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11953#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11953#comment:1" title="Comment 1">ramey</a>: </p> <blockquote class="citation"> <p> Hmmm - very interesting. What are the two different characters. What is the global local setting during the two tests? </p> </blockquote> <p> I've attached sample files diff position 0x400 IGhpbeKA (canonical) IGhpbZdp (boost) </p> <p> Machine locale is English, US </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sat, 12 Mar 2016 19:56:35 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11953#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11953#comment:3</guid> <description> <p> just in case it would help, machine info<br /> Win7, x64<br /> VS2015, boost obtained using nuget package, built for x64 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Thu, 04 May 2017 20:49:40 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11953#comment:4 https://svn.boost.org/trac10/ticket/11953#comment:4 <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">worksforme</span> </li> </ul> <p> FWIW - I compiled and ran your sample program on my recent version of clang with my Mac OS X. I ran under the debugger and checked the output characters at positions 1028-1031 and they all matched the ones in your file - canonic.txt. In other words, I can't reproduce the problem on my machine. The whole question of uft8 on windows machines is very confusing </p> Ticket kreuzerkrieg@… Thu, 04 May 2017 20:57:49 GMT <link>https://svn.boost.org/trac10/ticket/11953#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11953#comment:5</guid> <description> <p> And you didn't change anything in the code last 15 months? What is so confusing about utf8 on whatever platform? it is well defined, be it windows, mac or Linux In any case, I will verify it once I'm back to the office. Should I check it with the latest boost </p> </description> <category>Ticket</category> </item> <item> <author>kreuzerkrieg@…</author> <pubDate>Thu, 04 May 2017 20:58:18 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11953#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11953#comment:5</guid> <description> <p> And you didn't change anything in the code last 15 months? What is so confusing about utf8 on whatever platform? it is well defined, be it windows, mac or Linux In any case, I will verify it once I'm back to the office. Should I check it with the latest boost? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 04 May 2017 20:59:20 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11953#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11953#comment:6</guid> <description> <p> and sorry for the duplicates </p> </description> <category>Ticket</category> </item> </channel> </rss>