Skip to content

Commit

Permalink
Fix todo: ISO-2022-CN is x-cp50227 in .NET (#97)
Browse files Browse the repository at this point in the history
* Fix todo: ISO-2022-CN is x-cp50227 in .NET

* Fix mistake with wrong replace alias

* Simplify documentation for iso-2022-cn

* Fix typo in `iso-2022-cn`

* Fix simplified

* Fix simplified (x2)
  • Loading branch information
rstm-sf authored and 304NotModified committed Nov 16, 2019
1 parent cb3dca2 commit 9f6a0d6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 10 additions & 2 deletions src/Core/CodepageName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ internal static class CodepageName
/// ISO 2022 Chinese codepage name.
/// </summary>
/// <remarks>
/// TODO: Not supported? Maybe fix to x-cp50227?
/// Supported by alias is x-cp50227 (Codepage 50227) in. NET. Codepage identifier 50229 is currently unsupported (see for example https://github.com/microsoft/referencesource/blob/17b97365645da62cf8a49444d979f94a59bbb155/mscorlib/system/text/iso2022encoding.cs#L92).
/// </remarks>
internal const string ISO_2022_CN = "iso-2022-ch";
internal const string ISO_2022_CN = "iso-2022-cn";

/// <summary>
/// ISO 2022 Korean codepage name.
Expand All @@ -110,6 +110,14 @@ internal static class CodepageName
/// ISO 2022 Japanese codepage name.
/// </summary>
internal const string ISO_2022_JP = "iso-2022-jp";

/// <summary>
/// ISO 2022 Simplified Chinese codepage name.
/// </summary>
/// <remarks>
/// Other alias is cp50227.
/// </remarks>
internal const string X_CP50227 = "x-cp50227";

/// <summary>
/// Big5 codepage name.
Expand Down
3 changes: 2 additions & 1 deletion src/DetectionDetail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public class DetectionDetail
new Dictionary<string, string>
{
// CP949 is superset of ks_c_5601-1987 (see https://github.com/CharsetDetector/UTF-unknown/pull/74#issuecomment-550362133)
{CodepageName.CP949, CodepageName.KS_C_5601_1987}
{CodepageName.CP949, CodepageName.KS_C_5601_1987},
{CodepageName.ISO_2022_CN, CodepageName.X_CP50227},
};

/// <summary>
Expand Down

0 comments on commit 9f6a0d6

Please sign in to comment.