diff --git a/kaitai/kaitaistream.cpp b/kaitai/kaitaistream.cpp index 414e615..f49da96 100644 --- a/kaitai/kaitaistream.cpp +++ b/kaitai/kaitaistream.cpp @@ -876,22 +876,10 @@ int kaitai::kstream::encoding_to_win_codepage(const char *src_enc) { std::string enc(src_enc); if (enc == "UTF-8") { return CP_UTF8; - } else if (enc == "UTF-16LE") { - return KAITAI_CP_UTF16LE; } else if (enc == "UTF-16BE") { return KAITAI_CP_UTF16BE; - } else if (enc == "IBM437") { - return 437; - } else if (enc == "IBM850") { - return 850; - } else if (enc == "SHIFT_JIS") { - return 932; - } else if (enc == "GB2312") { - return 936; - } else if (enc == "ASCII") { - return 20127; - } else if (enc == "EUC-JP") { - return 20932; + } else if (enc == "UTF-16LE") { + return KAITAI_CP_UTF16LE; } else if (enc == "ISO-8859-1") { return 28591; } else if (enc == "ISO-8859-2") { @@ -934,6 +922,24 @@ int kaitai::kstream::encoding_to_win_codepage(const char *src_enc) { // > The Windows code page number for this encoding is 28606, but kernel32.dll // > does not support this encoding. return KAITAI_CP_UNSUPPORTED; + } else if (enc == "IBM437") { + return 437; + } else if (enc == "IBM850") { + return 850; + } else if (enc == "IBM866") { + return 866; + } else if (enc == "Shift_JIS") { + return 932; + } else if (enc == "GB2312") { + return 936; + } else if (enc == "Big5") { + return 950; + } else if (enc == "ASCII") { + return 20127; + } else if (enc == "EUC-JP") { + return 20932; + } else if (enc == "EUC-KR") { + return 51949; } return KAITAI_CP_UNSUPPORTED;