-1

I get a stream in UTF8 format, But i would like to get it in UTF16 format as i get some unsupported international characters in C#. How do i achieve this

user183781
  • 31
  • 5

1 Answers1

0

If you get unsupported international characters the encoding you'd likely want to use is not UTF16 but: iso-8859-1

It correctly encodes characters such as: æ, ø, å

So when you declare your StreamReader you'd want to setup the encoding to use:

var sReader = new StreamReader(hResponse.GetResponseStream,
                               Encoding.GetEncoding("ISO-8859-1"));

Hope this helps.