System.Text.Encoding.GetEncoding("iso-8859-1") throws PlatformNotSupportedException?

user49572 picture user49572 · Dec 29, 2008 · Viewed 55.6k times · Source

See subject, note that this question only applies to the .NET compact framework. This happens on the emulators that ship with Windows Mobile 6 Professional SDK as well as on my English HTC Touch Pro (all .NET CF 3.5). iso-8859-1 stands for Western European (ISO), which is probably the most important encoding besides us-ascii (at least when one goes by the number of usenet posts).

I'm having a hard time to understand why this encoding is not supported, while the following ones are supported (again on both the emulators & my HTC):

  • iso-8859-2 (Central European (ISO))
  • iso-8859-3 (Latin 3 (ISO))
  • iso-8859-4 (Baltic (ISO))
  • iso-8859-5 (Cyrillic (ISO))
  • iso-8859-7 (Greek (ISO))

So, is support for say Greek more important than support for German, French and Spanish? Can anyone shed some light on this?

Thanks!

Andreas

Answer

splattne picture splattne · Dec 29, 2008

I would try to use "windows-1252" as encoding string. According to Wikipedia, Windows-1252 is a superset of ISO-8859-1.

System.Text.Encoding.GetEncoding(1252)