This problem came about due to the fact I couldn't figure out how to implement (in your code) decode(in.end()). I really did try but concluded that I couldn't do with out losing the ablity to buid up my string translators by stepwise composition of inline code. This latter was important to me to guarentee optimal code generation so I wouldn't be tempted to make a bunch of translators for every combination. After much frustation I came to realized that it was easier to just avoid using (decode(in.end())). See test_iterators_base64 so use something like So your case might be altered to interate not on the input characters but rather on the output
typedef transform_width
std::(w?)string::const_iterator,32,6> decode; std::wostringstream out;
std::ostream_iterator
Hi,
I need to write a std::wstring which can contain binary data like \0 to a xml attribute, so I'm converting it to base64 but I have problems decoding it: std::copy(decode(in.begin()),decode(in.end()),);
is this a correct way to decode base64? it works, but only if (bits % 6 == 0). otherwise the program is abort()ed due to an exception.
the string was encoded by base64_from_binary
std::wstring::const_iterator,6,32 Thanks,