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

better charset detection #1268

Merged
merged 2 commits into from
Feb 19, 2022
Merged
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
11 changes: 7 additions & 4 deletions far2l/src/locale/DetectCodepage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ static int TranslateUDCharset(const char *cs)
return atoi(cs + 2);
}

if (strncasecmp(cs, "IBM", 3) == 0 && IsDecimalNumber(cs + 3)) {
return atoi(cs + 3);
}

if (!strcasecmp(cs, "UTF16-LE") || !strcasecmp(cs, "UTF16"))
return CP_UTF16LE;
Expand All @@ -46,10 +49,10 @@ static int TranslateUDCharset(const char *cs)
return CP_UTF8;
if (!strcasecmp(cs, "UTF-7"))
return CP_UTF7;
if (!strcasecmp(cs, "IBM855"))
return 855;
if (!strcasecmp(cs, "IBM866"))
return 866;
// if (!strcasecmp(cs, "IBM855"))
// return 855;
// if (!strcasecmp(cs, "IBM866"))
// return 866;
if (!strcasecmp(cs, "KOI8-R"))
return 20866;
if (!strcasecmp(cs, "KOI8-U"))
Expand Down