
11 Mar
2005
11 Mar
'05
2:04 a.m.
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: typedef transform_width<binary_from_base64<std::string::const_iterator>,32,6> decode; std::wostringstream out; std::copy(decode(in.begin()),decode(in.end()),std::ostream_iterator<wchar_t,wchar_t>(out)); 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<transform_width<std::wstring::const_iterator,6,32> > Thanks, -- Stefan Strasser