Mono’s Encoding.GetEncoding

I ran into another small difference that is a bit annoying and I am not for sure if it will become a big deal or not. When using Encoding.GetEncoding in mono with “SHIFT-JIS” I get the following…

Unhandled Exception: System.NotSupportedException: Encoding name `SHIFT-JIS' not supported
  at System.Text.Encoding.GetEncoding (System.String name) [0x00000]
  at KantLibrary.Translation.ExciteJapanTranslator.Translate (System.String sourceText, Code from, Code to) [0x00000]
  at Search.Program.Main (System.String[] args) [0x00000]

However, on windows it does what is suppose to do and gives the shift-jis encoding. The way around this, it seems, is to not use the names of encodings, but instead the code page number. I have a number of configuration files that have encoding names in them and will have to figure what to do rectify the problem.

Comments are closed.