confused by the encoding stuff. are Encoding.UTF8.GetBytes
and Convert.FromBase64St开发者_如何学运维ring
are the same?
er... no. Base64
is a particular way of encoding binary data in an ASCII (7-bit) stream, usually for transmitting through some other media (email, etc...).
UTF8
is the way of encoding Unicode text as a series of bytes without having to use multiple characters for 7-bit ASCII characters.
In other words: One is for binary data, the other is for text.
Side note: Strings in .NET are already in UTF16, and there are other methods for writing to files and streams as UTF8.
精彩评论