+static rc_uint_type wind_WideCharToMultiByte (rc_uint_type, const unichar *, char *, rc_uint_type);
+static rc_uint_type wind_MultiByteToWideChar (rc_uint_type, const char *, unichar *, rc_uint_type);
+static int unichar_isascii (const unichar *, rc_uint_type);
+
+/* Convert an ASCII string to a unicode string. We just copy it,
+ expanding chars to shorts, rather than doing something intelligent. */
+
+#if !defined (_WIN32) && !defined (__CYGWIN__)
+
+/* Codepages mapped. */
+static local_iconv_map codepages[] =
+{
+ { 0, "cp1252" },
+ { 1, "WINDOWS-1252" },
+ { 437, "MS-ANSI" },
+ { 737, "MS-GREEK" },
+ { 775, "WINBALTRIM" },
+ { 850, "MS-ANSI" },
+ { 852, "MS-EE" },
+ { 857, "MS-TURK" },
+ { 862, "CP862" },
+ { 864, "CP864" },
+ { 866, "MS-CYRL" },
+ { 874, "WINDOWS-874" },
+ { 932, "CP932" },
+ { 936, "CP936" },
+ { 949, "CP949" },
+ { 950, "CP950" },
+ { 1250, "WINDOWS-1250" },
+ { 1251, "WINDOWS-1251" },
+ { 1252, "WINDOWS-1252" },
+ { 1253, "WINDOWS-1253" },
+ { 1254, "WINDOWS-1254" },
+ { 1255, "WINDOWS-1255" },
+ { 1256, "WINDOWS-1256" },
+ { 1257, "WINDOWS-1257" },
+ { 1258, "WINDOWS-1258" },
+ { CP_UTF7, "UTF-7" },
+ { CP_UTF8, "UTF-8" },
+ { CP_UTF16, "UTF-16LE" },
+ { (rc_uint_type) -1, NULL }
+};
+
+/* Languages supported. */
+static const wind_language_t languages[] =
+{
+ { 0x0000, 437, 1252, "Neutral", "Neutral" },
+ { 0x0401, 864, 1256, "Arabic", "Saudi Arabia" }, { 0x0402, 866, 1251, "Bulgarian", "Bulgaria" },
+ { 0x0403, 850, 1252, "Catalan", "Spain" }, { 0x0404, 950, 950, "Chinese", "Taiwan" },
+ { 0x0405, 852, 1250, "Czech", "Czech Republic" }, { 0x0406, 850, 1252, "Danish", "Denmark" },
+ { 0x0407, 850, 1252, "German", "Germany" }, { 0x0408, 737, 1253, "Greek", "Greece" },
+ { 0x0409, 437, 1252, "English", "United States" }, { 0x040A, 850, 1252, "Spanish - Traditional Sort", "Spain" },
+ { 0x040B, 850, 1252, "Finnish", "Finland" }, { 0x040C, 850, 1252, "French", "France" },
+ { 0x040D, 862, 1255, "Hebrew", "Israel" }, { 0x040E, 852, 1250, "Hungarian", "Hungary" },
+ { 0x040F, 850, 1252, "Icelandic", "Iceland" }, { 0x0410, 850, 1252, "Italian", "Italy" },
+ { 0x0411, 932, 932, "Japanese", "Japan" }, { 0x0412, 949, 949, "Korean", "Korea (south)" },
+ { 0x0413, 850, 1252, "Dutch", "Netherlands" }, { 0x0414, 850, 1252, "Norwegian (Bokm\345l)", "Norway" },
+ { 0x0415, 852, 1250, "Polish", "Poland" }, { 0x0416, 850, 1252, "Portuguese", "Brazil" },
+ { 0x0418, 852, 1250, "Romanian", "Romania" }, { 0x0419, 866, 1251, "Russian", "Russia" },
+ { 0x041A, 852, 1250, "Croatian", "Croatia" }, { 0x041B, 852, 1250, "Slovak", "Slovakia" },
+ { 0x041C, 852, 1250, "Albanian", "Albania" }, { 0x041D, 850, 1252, "Swedish", "Sweden" },
+ { 0x041E, 874, 874, "Thai", "Thailand" }, { 0x041F, 857, 1254, "Turkish", "Turkey" },
+ { 0x0421, 850, 1252, "Indonesian", "Indonesia" }, { 0x0422, 866, 1251, "Ukrainian", "Ukraine" },
+ { 0x0423, 866, 1251, "Belarusian", "Belarus" }, { 0x0424, 852, 1250, "Slovene", "Slovenia" },
+ { 0x0425, 775, 1257, "Estonian", "Estonia" }, { 0x0426, 775, 1257, "Latvian", "Latvia" },
+ { 0x0427, 775, 1257, "Lithuanian", "Lithuania" },
+ { 0x0429, 864, 1256, "Arabic", "Farsi" }, { 0x042A,1258, 1258, "Vietnamese", "Vietnam" },
+ { 0x042D, 850, 1252, "Basque", "Spain" },
+ { 0x042F, 866, 1251, "Macedonian", "Former Yugoslav Republic of Macedonia" },
+ { 0x0436, 850, 1252, "Afrikaans", "South Africa" },
+ { 0x0438, 850, 1252, "Faroese", "Faroe Islands" },
+ { 0x043C, 437, 1252, "Irish", "Ireland" },
+ { 0x043E, 850, 1252, "Malay", "Malaysia" },
+ { 0x0801, 864, 1256, "Arabic", "Iraq" },
+ { 0x0804, 936, 936, "Chinese (People's republic of China)", "People's republic of China" },
+ { 0x0807, 850, 1252, "German", "Switzerland" },
+ { 0x0809, 850, 1252, "English", "United Kingdom" }, { 0x080A, 850, 1252, "Spanish", "Mexico" },
+ { 0x080C, 850, 1252, "French", "Belgium" },
+ { 0x0810, 850, 1252, "Italian", "Switzerland" },
+ { 0x0813, 850, 1252, "Dutch", "Belgium" }, { 0x0814, 850, 1252, "Norwegian (Nynorsk)", "Norway" },
+ { 0x0816, 850, 1252, "Portuguese", "Portugal" },
+ { 0x081A, 852, 1252, "Serbian (latin)", "Yugoslavia" },
+ { 0x081D, 850, 1252, "Swedish (Finland)", "Finland" },
+ { 0x0C01, 864, 1256, "Arabic", "Egypt" },
+ { 0x0C04, 950, 950, "Chinese", "Hong Kong" },
+ { 0x0C07, 850, 1252, "German", "Austria" },
+ { 0x0C09, 850, 1252, "English", "Australia" }, { 0x0C0A, 850, 1252, "Spanish - International Sort", "Spain" },
+ { 0x0C0C, 850, 1252, "French", "Canada"},
+ { 0x0C1A, 855, 1251, "Serbian (Cyrillic)", "Serbia" },
+ { 0x1001, 864, 1256, "Arabic", "Libya" },
+ { 0x1004, 936, 936, "Chinese", "Singapore" },
+ { 0x1007, 850, 1252, "German", "Luxembourg" },
+ { 0x1009, 850, 1252, "English", "Canada" },
+ { 0x100A, 850, 1252, "Spanish", "Guatemala" },
+ { 0x100C, 850, 1252, "French", "Switzerland" },
+ { 0x1401, 864, 1256, "Arabic", "Algeria" },
+ { 0x1407, 850, 1252, "German", "Liechtenstein" },
+ { 0x1409, 850, 1252, "English", "New Zealand" }, { 0x140A, 850, 1252, "Spanish", "Costa Rica" },
+ { 0x140C, 850, 1252, "French", "Luxembourg" },
+ { 0x1801, 864, 1256, "Arabic", "Morocco" },
+ { 0x1809, 850, 1252, "English", "Ireland" }, { 0x180A, 850, 1252, "Spanish", "Panama" },
+ { 0x180C, 850, 1252, "French", "Monaco" },
+ { 0x1C01, 864, 1256, "Arabic", "Tunisia" },
+ { 0x1C09, 437, 1252, "English", "South Africa" }, { 0x1C0A, 850, 1252, "Spanish", "Dominican Republic" },
+ { 0x2001, 864, 1256, "Arabic", "Oman" },
+ { 0x2009, 850, 1252, "English", "Jamaica" }, { 0x200A, 850, 1252, "Spanish", "Venezuela" },
+ { 0x2401, 864, 1256, "Arabic", "Yemen" },
+ { 0x2409, 850, 1252, "English", "Caribbean" }, { 0x240A, 850, 1252, "Spanish", "Colombia" },
+ { 0x2801, 864, 1256, "Arabic", "Syria" },
+ { 0x2809, 850, 1252, "English", "Belize" }, { 0x280A, 850, 1252, "Spanish", "Peru" },
+ { 0x2C01, 864, 1256, "Arabic", "Jordan" },
+ { 0x2C09, 437, 1252, "English", "Trinidad & Tobago" },{ 0x2C0A, 850, 1252, "Spanish", "Argentina" },
+ { 0x3001, 864, 1256, "Arabic", "Lebanon" },
+ { 0x3009, 437, 1252, "English", "Zimbabwe" }, { 0x300A, 850, 1252, "Spanish", "Ecuador" },
+ { 0x3401, 864, 1256, "Arabic", "Kuwait" },
+ { 0x3409, 437, 1252, "English", "Philippines" }, { 0x340A, 850, 1252, "Spanish", "Chile" },
+ { 0x3801, 864, 1256, "Arabic", "United Arab Emirates" },
+ { 0x380A, 850, 1252, "Spanish", "Uruguay" },
+ { 0x3C01, 864, 1256, "Arabic", "Bahrain" },
+ { 0x3C0A, 850, 1252, "Spanish", "Paraguay" },
+ { 0x4001, 864, 1256, "Arabic", "Qatar" },
+ { 0x400A, 850, 1252, "Spanish", "Bolivia" },
+ { 0x440A, 850, 1252, "Spanish", "El Salvador" },
+ { 0x480A, 850, 1252, "Spanish", "Honduras" },
+ { 0x4C0A, 850, 1252, "Spanish", "Nicaragua" },
+ { 0x500A, 850, 1252, "Spanish", "Puerto Rico" },
+ { (unsigned) -1, 0, 0, NULL, NULL }
+};
+
+#endif
+
+/* Specifies the default codepage to be used for unicode
+ transformations. By default this is CP_ACP. */
+rc_uint_type wind_default_codepage = CP_ACP;
+
+/* Specifies the currently used codepage for unicode
+ transformations. By default this is CP_ACP. */
+rc_uint_type wind_current_codepage = CP_ACP;
+