This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 32137 - System.Text.Encoding.UTF8.EncodingName not the returning human-readable description of the current encoding
Summary: System.Text.Encoding.UTF8.EncodingName not the returning human-readable descr...
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: CORLIB (show other bugs)
Version: 4.0.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2015-07-20 06:37 UTC by Adam Hartley
Modified: 2015-07-21 08:44 UTC (History)
5 users (show)

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


Attachments
Sample (68.03 KB, application/zip)
2015-07-20 06:45 UTC, Adam Hartley
Details

Description Adam Hartley 2015-07-20 06:37:06 UTC
## Overview

When calling System.Text.Encoding.UTF8.EncodingName, the resulting string is not the human-readable description of the encoding.

## Steps to reproduce

1. Download attached sample.
2. Run either the Android or iOS sample and tap the button.
3. Observe the displayed title for the button.

## Expected result

"Unicode (UTF-8)" should be returned.

## Actual result

"Globalization.cp_65001" is displayed.


## Notes

Included in the zip is a simple C# console app which you can run on Windows and see the expected result

When run with Mono on OS X you will see the erroneous result.
Comment 2 Adam Hartley 2015-07-20 06:45:44 UTC
Created attachment 12109 [details]
Sample
Comment 3 gcnew 2015-07-20 07:24:44 UTC
The following encodings also return unreadable description:
Encoding.ASCII,
Encoding.BigEndianUnicode,
Encoding.Unicode,
Encoding.UTF32,
Encoding.UTF7
Comment 4 Marek Safar 2015-07-21 08:44:57 UTC
Fixed in master and Mono 4.2

Note You need to log in before you can comment on or make changes to this bug.