Bug 33112 - Encoding.ASCII.EncodingName has value "Globalization.cp_20127"
Summary: Encoding.ASCII.EncodingName has value "Globalization.cp_20127"
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: General ()
Version: 4.0.0
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2015-08-14 13:12 UTC by Thomas Jepp
Modified: 2015-08-14 15:02 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Program showing encoding names (1.12 KB, text/plain)
2015-08-14 13:12 UTC, Thomas Jepp
Details
Output from the above test program when run on Mono 4.0.3 (10.20 KB, text/plain)
2015-08-14 13:13 UTC, Thomas Jepp
Details
Output from the above test program when run on Windows 10 (14.80 KB, text/plain)
2015-08-14 13:14 UTC, Thomas Jepp
Details
A diff showing the differences between the two test outputs (19.05 KB, application/octet-stream)
2015-08-14 13:18 UTC, Thomas Jepp
Details
A diff showing the differences between the two test outputs (now correct mime type) (19.05 KB, text/plain)
2015-08-14 13:19 UTC, Thomas Jepp
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Thomas Jepp 2015-08-14 13:12:17 UTC
Created attachment 12502 [details]
Program showing encoding names

Hi,

We've been testing our application for running on up-to-date Mono from the mono-project.com debian repositories.

When testing, we've found that the following code causes an exception on Mono 4.0.3 - this used to work on 3.4, and works on MS .NET:

Encoding asciiEncoding = Encoding.GetEncoding(Encoding.ASCII.EncodingName, new EncoderReplacementFallback(string.Empty), new DecoderExceptionFallback());

This throws:

System.ArgumentException: 'Globalization.cp_20127' is not a supported encoding name.
Parameter name: name
  at System.Globalization.EncodingTable.internalGetCodePageFromName (System.String name) [0x00000] in <filename unknown>:0
  at System.Globalization.EncodingTable.GetCodePageFromName (System.String name) [0x00000] in <filename unknown>:0
  at System.Text.Encoding.GetEncoding (System.String name, System.Text.EncoderFallback encoderFallback, System.Text.DecoderFallback decoderFallback) [0x00000] in <filename unknown>:0
...

The attached test program (a modified version of the program available at https://msdn.microsoft.com/en-us/library/system.text.encoding.codepage%28v=vs.110%29.aspx) shows all of the output for encoding names. I will also attach an example of the output on .NET 4.6 (Windows 10) vs Mono 4.0.3. There are quite a few differences in Encoding names.
Comment 1 Thomas Jepp 2015-08-14 13:13:45 UTC
Created attachment 12503 [details]
Output from the above test program when run on Mono 4.0.3
Comment 2 Thomas Jepp 2015-08-14 13:14:01 UTC
Created attachment 12504 [details]
Output from the above test program when run on Windows 10
Comment 3 Thomas Jepp 2015-08-14 13:18:55 UTC
Created attachment 12505 [details]
A diff showing the differences between the two test outputs
Comment 4 Thomas Jepp 2015-08-14 13:19:37 UTC
Created attachment 12506 [details]
A diff showing the differences between the two test outputs (now correct mime type)
Comment 5 Marek Safar 2015-08-14 15:02:15 UTC
Already fixed in master and Mono 4.2