Search code examples
c++base64widestring

C++ how convert wide string to base64?


What is the best way to convert wide string to base64?


Solution

  • Octet (8 bit symbols) -> Base64 (6 bit symbols) conversion works on bytes, not characters, so it works the same way independent of your string encoding.


    To be clear: Base64 is not a character encoding. Sender and receiver need to agree on the character encoding (ASCII, UTF-8, UTF-16, UCS-2, etc) as well as the transport method (Base64, gzip, etc).