Convert .net String object into base64 encoded string
Posted
by chester89
on Stack Overflow
See other posts from Stack Overflow
or by chester89
Published on 2010-04-13T18:39:21Z
Indexed on
2010/04/13
18:42 UTC
Read the original article
Hit count: 388
I have a question, which Unicode encoding to use while encoding .NET string into base64? I know strings are UTF-16 encoded on Windows, so is my way of encoding is the right one?
public static String ToBase64String(this String source) {
return Convert.ToBase64String(Encoding.Unicode.GetBytes(source));
}
© Stack Overflow or respective owner