COMMON: Add conversion table for CP1254

This commit is contained in:
lolbot-iichan 2019-07-21 04:56:37 +03:00 committed by Filippos Karapetis
parent e5144e9590
commit 567a6b20e6
2 changed files with 24 additions and 0 deletions

View File

@ -593,6 +593,23 @@ static const uint32 g_windows1253ConversionTable[] = {0x20AC, 0x0081, 0x201A, 0x
0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7,
0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x00FF};
static const uint32 g_windows1254ConversionTable[] = {0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x008D, 0x008E, 0x008F,
0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x009D, 0x009E, 0x0178,
0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7,
0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
0x011E, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7,
0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0130, 0x015E, 0x00DF,
0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7,
0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
0x011F, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7,
0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0131, 0x015F, 0x00FF};
static const uint32 g_windows1255ConversionTable[] = {0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
0x02C6, 0x2030, 0x008A, 0x2039, 0x008C, 0x008D, 0x008E, 0x008F,
0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
@ -655,6 +672,9 @@ U32String convertToU32String(const char *str, CodePage page) {
case kWindows1253:
unicodeString += g_windows1253ConversionTable[index];
break;
case kWindows1254:
unicodeString += g_windows1254ConversionTable[index];
break;
case kWindows1255:
unicodeString += g_windows1255ConversionTable[index];
break;
@ -687,6 +707,9 @@ String convertFromU32String(const U32String &string, CodePage page) {
case kWindows1253:
conversionTable = g_windows1253ConversionTable;
break;
case kWindows1254:
conversionTable = g_windows1254ConversionTable;
break;
case kWindows1255:
conversionTable = g_windows1255ConversionTable;
break;

View File

@ -226,6 +226,7 @@ enum CodePage {
kWindows1251,
kWindows1252,
kWindows1253,
kWindows1254,
kWindows1255,
kWindows1257
};