PlatformNotSupportedException when using System.Text.Encoding.GetEncoding("iso-8859-9")

  • Thread starter Thread starter SevDer
  • Start date Start date
S

SevDer

The code below makes this error.

StreamReader myReader = new
StreamReader(myWebResponse.GetResponseStream(),System.Text.Encoding.GetEncoding("iso-8859-9"));

if I use

StreamReader myReader = new StreamReader(myWebResponse.GetResponseStream());

then I don't have any problems, but this time I cannot get the special
characters.

How can I fix this or how can I get the special characters without any loss?

Thanks in advance
SevDer
http://www.sevder.com
 
Internally GetEncoding asks the underlying OS to provide the specified
codepage information. Obviously the OS must know this codepage. In your case
asking for Turkick variant of Latin 5 fails, since you are using
non-localized device which lacks support of that specific codepage. You need
either to obtain a localized device or to use Unicode (or UTF-8)
 
Back
Top