From the Base64Encoder docs, the signature of the constructor is
Base64Encoder (BufferedTransformation *attachment=NULL, bool insertLineBreaks=true, int maxLineLength=72)
So you get line breaks by default in your encoded string. To avoid this, just do:
CryptoPP::StringSource ss(
in,
true,
new CryptoPP::Base64Encoder(
new CryptoPP::StringSink(encoded),
false
)
);