ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

codepage.h

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef WIN32_CODEPAGE_H
00024 #define WIN32_CODEPAGE_H
00025 
00026 #include "common/scummsys.h"
00027 #include "common/str.h"
00028 namespace Win32 {
00029 struct CodePageDescription {
00030     const char *name;
00031     int id;
00032 };
00033 
00034 //For more info look at https://docs.microsoft.com/en-us/windows/win32/intl/code-page-identifiers
00035 //If there is a different name for a codepage, just add another row.
00036 const CodePageDescription g_cpDescriptions[] = {
00037     {"ibm037", 37}, //IBM EBCDIC US-Canada
00038     {"ibm437", 437}, //OEM United States
00039     {"ibm500", 500}, //IBM EBCDIC International
00040     {"asmo-708", 708}, //Arabic (ASMO 708)
00041     {"arabic1", 709}, //Arabic (ASMO-449+, BCON V4)
00042     {"arabic2", 710}, //Arabic - Transparent Arabic
00043     {"dos-720", 720}, //Arabic (Transparent ASMO); Arabic (DOS)
00044     {"ibm737", 737}, //OEM Greek (formerly 437G); Greek (DOS)
00045     {"ibm775", 775}, //OEM Baltic; Baltic (DOS)
00046     {"ibm850", 850}, //OEM Multilingual Latin 1; Western European (DOS)
00047     {"cp850", 850}, //OEM Multilingual Latin 1; Western European (DOS)
00048     {"ascii", 850}, //We have multiple choices for codepage for ascii, this is one of many that works
00049     {"ibm852", 852}, //OEM Latin 2; Central European (DOS)
00050     {"ibm855", 855}, //OEM Cyrillic (primarily Russian)
00051     {"ibm857", 857}, //OEM Turkish; Turkish (DOS)
00052     {"ibm00858", 858}, //OEM Multilingual Latin 1 + Euro symbol
00053     {"ibm858", 858}, //OEM Multilingual Latin 1 + Euro symbol
00054     {"ibm860", 860}, //OEM Portuguese; Portuguese (DOS)
00055     {"ibm861", 861}, //OEM Icelandic; Icelandic (DOS)
00056     {"dos-862", 862}, //OEM Hebrew; Hebrew (DOS)
00057     {"ibm863", 863}, //OEM French Canadian; French Canadian (DOS)
00058     {"ibm864", 864}, //OEM Arabic; Arabic (864)
00059     {"ibm865", 865}, //OEM Nordic; Nordic (DOS)
00060     {"cp866", 866}, //OEM Russian; Cyrillic (DOS)
00061     {"ibm869", 869}, //OEM Modern Greek; Greek, Modern (DOS)
00062     {"ibm870", 870}, //IBM EBCDIC Multilingual/ROECE (Latin 2); IBM EBCDIC Multilingual Latin 2
00063     {"windows-874", 874}, //ANSI/OEM Thai (ISO 8859-11); Thai (Windows)
00064     {"cp875", 875}, //IBM EBCDIC Greek Modern
00065     {"shift_jis", 932}, //ANSI/OEM Japanese; Japanese (Shift-JIS)
00066     {"gb2312", 936}, //ANSI/OEM Simplified Chinese (PRC, Singapore); Chinese Simplified (GB2312)
00067     {"ks_c_5601-1987", 949}, //ANSI/OEM Korean (Unified Hangul Code)
00068     {"big5", 950}, //ANSI/OEM Traditional Chinese (Taiwan; Hong Kong SAR, PRC); Chinese Traditional (Big5)
00069     {"ibm1026", 1026}, //IBM EBCDIC Turkish (Latin 5)
00070     {"ibm01047", 1047}, //IBM EBCDIC Latin 1/Open System
00071     {"ibm01140", 1140}, //IBM EBCDIC US-Canada (037 + Euro symbol); IBM EBCDIC (US-Canada-Euro)
00072     {"ibm01141", 1141}, //IBM EBCDIC Germany (20273 + Euro symbol); IBM EBCDIC (Germany-Euro)
00073     {"ibm01142", 1142}, //IBM EBCDIC Denmark-Norway (20277 + Euro symbol); IBM EBCDIC (Denmark-Norway-Euro)
00074     {"ibm01143", 1143}, //IBM EBCDIC Finland-Sweden (20278 + Euro symbol); IBM EBCDIC (Finland-Sweden-Euro)
00075     {"ibm01144", 1144}, //IBM EBCDIC Italy (20280 + Euro symbol); IBM EBCDIC (Italy-Euro)
00076     {"ibm01145", 1145}, //IBM EBCDIC Latin America-Spain (20284 + Euro symbol); IBM EBCDIC (Spain-Euro)
00077     {"ibm01146", 1146}, //IBM EBCDIC United Kingdom (20285 + Euro symbol); IBM EBCDIC (UK-Euro)
00078     {"ibm01147", 1147}, //IBM EBCDIC France (20297 + Euro symbol); IBM EBCDIC (France-Euro)
00079     {"ibm01148", 1148}, //IBM EBCDIC International (500 + Euro symbol); IBM EBCDIC (International-Euro)
00080     {"ibm01149", 1149}, //IBM EBCDIC Icelandic (20871 + Euro symbol); IBM EBCDIC (Icelandic-Euro)
00081     {"utf-16", 1200}, //Unicode UTF-16, little endian byte order (BMP of ISO 10646); available only to managed applications
00082     {"unicodefffe", 1201}, //Unicode UTF-16, big endian byte order; available only to managed applications
00083     {"windows-1250", 1250}, //ANSI Central European; Central European (Windows)
00084     {"windows-1251", 1251}, //ANSI Cyrillic; Cyrillic (Windows)
00085     {"windows-1252", 1252}, //ANSI Latin 1; Western European (Windows)
00086     {"windows-1253", 1253}, //ANSI Greek; Greek (Windows)
00087     {"windows-1254", 1254}, //ANSI Turkish; Turkish (Windows)
00088     {"windows-1255", 1255}, //ANSI Hebrew; Hebrew (Windows)
00089     {"windows-1256", 1256}, //ANSI Arabic; Arabic (Windows)
00090     {"windows-1257", 1257}, //ANSI Baltic; Baltic (Windows)
00091     {"windows-1258", 1258}, //ANSI/OEM Vietnamese; Vietnamese (Windows)
00092     {"johab", 1361}, //Korean (Johab)
00093     {"macintosh", 10000}, //MAC Roman; Western European (Mac)
00094     {"x-mac-japanese", 10001}, //Japanese (Mac)
00095     {"x-mac-chinesetrad", 10002}, //MAC Traditional Chinese (Big5); Chinese Traditional (Mac)
00096     {"x-mac-korean", 10003}, //Korean (Mac)
00097     {"x-mac-arabic", 10004}, //Arabic (Mac)
00098     {"x-mac-hebrew", 10005}, //Hebrew (Mac)
00099     {"x-mac-greek", 10006}, //Greek (Mac)
00100     {"x-mac-cyrillic", 10007}, //Cyrillic (Mac)
00101     {"x-mac-chinesesimp", 10008}, //MAC Simplified Chinese (GB 2312); Chinese Simplified (Mac)
00102     {"x-mac-romanian", 10010}, //Romanian (Mac)
00103     {"x-mac-ukrainian", 10017}, //Ukrainian (Mac)
00104     {"x-mac-thai", 10021}, //Thai (Mac)
00105     {"x-mac-ce", 10029}, //MAC Latin 2; Central European (Mac)
00106     {"x-mac-icelandic", 10079}, //Icelandic (Mac)
00107     {"x-mac-turkish", 10081}, //Turkish (Mac)
00108     {"x-mac-croatian", 10082}, //Croatian (Mac)
00109     {"utf-32", 12000}, //Unicode UTF-32, little endian byte order; available only to managed applications
00110     {"utf-32be", 12001}, //Unicode UTF-32, big endian byte order; available only to managed applications
00111     {"x-chinese_cns", 20000}, //CNS Taiwan; Chinese Traditional (CNS)
00112     {"x-cp20001", 20001}, //TCA Taiwan
00113     {"x_chinese-eten", 20002}, //Eten Taiwan; Chinese Traditional (Eten)
00114     {"x-cp20003", 20003}, //IBM5550 Taiwan
00115     {"x-cp20004", 20004}, //TeleText Taiwan
00116     {"x-cp20005", 20005}, //Wang Taiwan
00117     {"x-ia5", 20105}, //IA5 (IRV International Alphabet No. 5, 7-bit); Western European (IA5)
00118     {"x-ia5-german", 20106}, //IA5 German (7-bit)
00119     {"x-ia5-swedish", 20107}, //IA5 Swedish (7-bit)
00120     {"x-ia5-norwegian", 20108}, //IA5 Norwegian (7-bit)
00121     {"us-ascii", 20127}, //US-ASCII (7-bit)
00122     {"x-cp20261", 20261}, //T.61
00123     {"x-cp20269", 20269}, //ISO 6937 Non-Spacing Accent
00124     {"ibm273", 20273}, //IBM EBCDIC Germany
00125     {"ibm277", 20277}, //IBM EBCDIC Denmark-Norway
00126     {"ibm278", 20278}, //IBM EBCDIC Finland-Sweden
00127     {"ibm280", 20280}, //IBM EBCDIC Italy
00128     {"ibm284", 20284}, //IBM EBCDIC Latin America-Spain
00129     {"ibm285", 20285}, //IBM EBCDIC United Kingdom
00130     {"ibm290", 20290}, //IBM EBCDIC Japanese Katakana Extended
00131     {"ibm297", 20297}, //IBM EBCDIC France
00132     {"ibm420", 20420}, //IBM EBCDIC Arabic
00133     {"ibm423", 20423}, //IBM EBCDIC Greek
00134     {"ibm424", 20424}, //IBM EBCDIC Hebrew
00135     {"x-ebcdic-koreanextended", 20833}, //IBM EBCDIC Korean Extended
00136     {"ibm-thai", 20838}, //IBM EBCDIC Thai
00137     {"koi8-r", 20866}, //Russian (KOI8-R); Cyrillic (KOI8-R)
00138     {"ibm871", 20871}, //IBM EBCDIC Icelandic
00139     {"ibm880", 20880}, //IBM EBCDIC Cyrillic Russian
00140     {"ibm905", 20905}, //IBM EBCDIC Turkish
00141     {"ibm00924", 20924}, //IBM EBCDIC Latin 1/Open System (1047 + Euro symbol)
00142     {"euc-jp", 20932}, //Japanese (JIS 0208-1990 and 0212-1990)
00143     {"x-cp20936", 20936}, //Simplified Chinese (GB2312); Chinese Simplified (GB2312-80)
00144     {"x-cp20949", 20949}, //Korean Wansung
00145     {"cp1025", 21025}, //IBM EBCDIC Cyrillic Serbian-Bulgarian
00146     {"deprecated", 21027},      //(deprecated)
00147     {"koi8-u", 21866}, //Ukrainian (KOI8-U); Cyrillic (KOI8-U)
00148     {"iso-8859-1", 28591}, //ISO 8859-1 Latin 1; Western European (ISO)
00149     {"iso-8859-2", 28592}, //ISO 8859-2 Central European; Central European (ISO)
00150     {"iso-8859-3", 28593}, //ISO 8859-3 Latin 3
00151     {"iso-8859-4", 28594}, //ISO 8859-4 Baltic
00152     {"iso-8859-5", 28595}, //ISO 8859-5 Cyrillic
00153     {"iso-8859-6", 28596}, //ISO 8859-6 Arabic
00154     {"kIso-8859-7", 28597}, //ISO 8859-7 Greek
00155     {"iso-8859-8", 28598}, //ISO 8859-8 Hebrew; Hebrew (ISO-Visual)
00156     {"iso-8859-9", 28599}, //ISO 8859-9 Turkish
00157     {"iso-8859-13", 28603}, //ISO 8859-13 Estonian
00158     {"iso-8859-15", 28605}, //ISO 8859-15 Latin 9
00159     {"x-europa", 29001}, //Europa 3
00160     {"iso-8859-8-i", 38598}, //ISO 8859-8 Hebrew; Hebrew (ISO-Logical)
00161     {"iso-2022-jp", 50220}, //ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS)
00162     {"csiso2022jp", 50221}, //ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow 1 byte Kana)
00163     {"iso-2022-jp", 50222}, //ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte Kana - SO/SI)
00164     {"iso-2022-kr", 50225}, //ISO 2022 Korean
00165     {"x-cp50227", 50227}, //ISO 2022 Simplified Chinese; Chinese Simplified (ISO 2022)
00166     {"iso2022", 50229}, //Traditional Chinese
00167     {"ebcdic1", 50930}, //Japanese (Katakana) Extended
00168     {"ebcdic2", 50931}, //US-Canada and Japanese
00169     {"ebcdic3", 50933}, //Korean Extended and Korean
00170     {"ebcdic4", 50935}, //Simplified Chinese Extended and Simplified Chinese
00171     {"ebcdic5", 50936}, //Simplified Chinese
00172     {"ebcdic6", 50937}, //US-Canada and Traditional Chinese
00173     {"ebcdic7", 50939}, //Japanese (Latin) Extended and Japanese
00174     {"euc-jp", 51932}, //EUC Japanese
00175     {"euc-cn", 51936}, //EUC Simplified Chinese; Chinese Simplified (EUC)
00176     {"euc-kr", 51949}, //EUC Korean
00177     {"euc", 51950}, //Traditional Chinese
00178     {"hz-gb-2312", 52936}, //HZ-GB2312 Simplified Chinese; Chinese Simplified (HZ)
00179     {"gb18030", 54936}, //Windows XP and later: GB18030 Simplified Chinese (4 byte); Chinese Simplified (GB18030)
00180     {"x-iscii-de", 57002}, //ISCII Devanagari
00181     {"x-iscii-be", 57003}, //ISCII Bangla
00182     {"x-iscii-ta", 57004}, //ISCII Tamil
00183     {"x-iscii-te", 57005}, //ISCII Telugu
00184     {"x-iscii-as", 57006}, //ISCII Assamese
00185     {"x-iscii-or", 57007}, //ISCII Odia
00186     {"x-iscii-ka", 57008}, //ISCII Kannada
00187     {"x-iscii-ma", 57009}, //ISCII Malayalam
00188     {"x-iscii-gu", 57010}, //ISCII Gujarati
00189     {"x-iscii-pa", 57011}, //ISCII Punjabi
00190     {"utf-7", 65000}, //Unicode (UTF-7)
00191     {"utf-8", 65001}, //Unicode (UTF-8) 
00192     {nullptr, 0}      //End
00193 };
00194 
00195 int getCodePageId(Common::String codePageName) {
00196     const CodePageDescription *cp = g_cpDescriptions;
00197     for (; cp->name; cp++) {
00198         if (codePageName.equalsIgnoreCase(cp->name))
00199             return cp->id;
00200     }
00201     return -1;
00202 }
00203 }
00204 
00205 #endif // WIN32_CODEPAGE_H


Generated on Sat Sep 26 2020 05:00:46 for ResidualVM by doxygen 1.7.1
curved edge   curved edge