Convert .net String object into base64 encoded string
- by chester89
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));
}