Subject: [Boost-bugs] [Boost C++ Libraries] #11953: Boost 1.60: boost::archive::iterators bug?
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-02-04 06:43:32
#11953: Boost 1.60: boost::archive::iterators bug?
------------------------------+---------------------------
Reporter: kreuzerkrieg@⦠| Owner: ramey
Type: Bugs | Status: new
Milestone: To Be Determined | Component: serialization
Version: Boost 1.60.0 | Severity: Problem
Keywords: |
------------------------------+---------------------------
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<bai::transform_width<std::string::const_iterator,
6, 8>>;
[[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, '=');
simple and elegant.[[BR]]
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 http://pastebin.com/JxMsMeV2
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11953> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC