Robert Ramey schrieb:
So your case might be altered to interate not on the input characters but rather on the output
Thanks! iterating on output works. in case someone else on the list is interested, below's the code.
a) i notices you're using a 32 bit wchar_t - note that this is non-portable. I would think about using std::vectorboost::int_least32. or maybe instead of using the "magic" number 32 you might want to try something like (sizeof(wchar_t) * 8).
32: yes, I've sent example code. int_least32: wstring/wchar_t is ok, it's a representation of a c++ wide string literal. (google for "metac++" for a reason)
b) I'm not sure I remember where I handled the padding. you should double check that your if your original binary string isn't modulo 6 bits you might find it filled with 0 after a round trip through base64.
I'm not sure what you mean here, how can an unencoded string whose CharT
is always > 6 bits be filled with 0 after round trip? base64 can, and
that's fine.
thanks again!
typedef
transform_width Robert Ramey Stefan Strasser wrote: 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 Thanks, _______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users --
Stefan Strasser