Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix todo: ISO-2022-CN is x-cp50227 in .NET #97

Merged
merged 6 commits into from
Nov 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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