![]() If you want to decode from iso-8859-2, you may try to set the encoding of your StreamReader before you attempt to read anything:Įncoding enc = Encoding.GetEncoding ("iso-8859-2") All the steps you are performing afterwards will either cancel out or produce more junk. Due to how UTF-8 works, ASCII will also work.Īt this point, you have an Unicode string, which may contain garbage if the input wasn't in one of the encodings your StreamReader could use. ![]() This happens according to whatever encoding the StreamReader is using: by default it's UTF-8, but itĬan also decode little-endian and big-endian Unicode as long as the stream contains the right byte order marks. ![]() When you perform a ReadLine on your StreamReader, that stream of bytes must be converted to a string. What you get off an SslStream is a stream of bytes. What you wrote cannot work, the problem being that there is an extra hidden conversion.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |