661 lines
30 KiB
C
661 lines
30 KiB
C
/* This software is licensed by the MIT License, see LICENSE file */
|
|
/* Copyright © 2022 Gregory Lirent */
|
|
|
|
#include "../build.h"
|
|
|
|
static unsigned int tolower_00c0_00df(unsigned int uc) __attribute__((noinline));
|
|
|
|
static unsigned int tolower_0100_01ff(unsigned int uc) __attribute__((noinline));
|
|
static unsigned int tolower_0200_024f(unsigned int uc) __attribute__((noinline));
|
|
static unsigned int tolower_0370_03ff(unsigned int uc) __attribute__((noinline));
|
|
static unsigned int tolower_0460_04ff(unsigned int uc) __attribute__((noinline));
|
|
static unsigned int tolower_0500_055f(unsigned int uc) __attribute__((noinline));
|
|
static unsigned int tolower_10a0_10cf(unsigned int uc) __attribute__((noinline));
|
|
static unsigned int tolower_13a0_13ff(unsigned int uc) __attribute__((noinline));
|
|
static unsigned int tolower_1c90_1cbf(unsigned int uc) __attribute__((noinline));
|
|
static unsigned int tolower_1e00_1eff(unsigned int uc) __attribute__((noinline));
|
|
static unsigned int tolower_1f00_1fff(unsigned int uc) __attribute__((noinline));
|
|
static unsigned int tolower_2c00_2cff(unsigned int uc) __attribute__((noinline));
|
|
static unsigned int tolower_a640_a69f(unsigned int uc) __attribute__((noinline));
|
|
static unsigned int tolower_a720_a7cf(unsigned int uc) __attribute__((noinline));
|
|
|
|
static unsigned int tolower_010400_0104df(unsigned int uc) __attribute__((noinline));
|
|
static unsigned int tolower_010c80_010cbf(unsigned int uc) __attribute__((noinline));
|
|
static unsigned int tolower_0118a0_0118bf(unsigned int uc) __attribute__((noinline));
|
|
|
|
|
|
|
|
static unsigned int tolower_00c0_00df(unsigned int uc) {
|
|
if (uc <= 0x00de) {
|
|
if (uc >= 0x00c0 && uc != 0x00d7) return uc | 0x20;
|
|
}
|
|
|
|
return uc;
|
|
}
|
|
|
|
static unsigned int tolower_0100_01ff(unsigned int uc) {
|
|
static unsigned char table[] = {
|
|
/* 0x000100 - 0x000107 */ 0x01, 0x00, 0x03, 0x00, 0x05, 0x00, 0x07, 0x00,
|
|
/* 0x000108 - 0x00010f */ 0x09, 0x00, 0x0b, 0x00, 0x0d, 0x00, 0x0f, 0x00,
|
|
/* 0x000110 - 0x000117 */ 0x11, 0x00, 0x13, 0x00, 0x15, 0x00, 0x17, 0x00,
|
|
/* 0x000118 - 0x00011f */ 0x19, 0x00, 0x1b, 0x00, 0x1d, 0x00, 0x1f, 0x00,
|
|
/* 0x000120 - 0x000127 */ 0x21, 0x00, 0x23, 0x00, 0x25, 0x00, 0x27, 0x00,
|
|
/* 0x000128 - 0x00012f */ 0x29, 0x00, 0x2b, 0x00, 0x2d, 0x00, 0x2f, 0x00,
|
|
/* 0x000130 - 0x000137 */ 0x31, 0x00, 0x33, 0x00, 0x35, 0x00, 0x37, 0x00,
|
|
/* 0x000138 - 0x00013f */ 0x00, 0x3a, 0x00, 0x3c, 0x00, 0x3e, 0x00, 0x40,
|
|
/* 0x000140 - 0x000147 */ 0x00, 0x42, 0x00, 0x44, 0x00, 0x46, 0x00, 0x48,
|
|
/* 0x000148 - 0x00014f */ 0x00, 0x00, 0x4b, 0x00, 0x4d, 0x00, 0x4f, 0x00,
|
|
/* 0x000150 - 0x000157 */ 0x51, 0x00, 0x53, 0x00, 0x55, 0x00, 0x57, 0x00,
|
|
/* 0x000158 - 0x00015f */ 0x59, 0x00, 0x5b, 0x00, 0x5d, 0x00, 0x5f, 0x00,
|
|
/* 0x000160 - 0x000167 */ 0x61, 0x00, 0x63, 0x00, 0x65, 0x00, 0x67, 0x00,
|
|
/* 0x000168 - 0x00016f */ 0x69, 0x00, 0x6b, 0x00, 0x6d, 0x00, 0x6f, 0x00,
|
|
/* 0x000170 - 0x000177 */ 0x71, 0x00, 0x73, 0x00, 0x75, 0x00, 0x77, 0x00,
|
|
/* 0x000178 - 0x00017f */ 0x00, 0x7a, 0x00, 0x7c, 0x00, 0x7e, 0x00, 0x00,
|
|
#ifndef LATIN_EXTENDED_B_DISABLE
|
|
/* 0x000180 - 0x000187 */ 0x00, 0x00, 0x83, 0x00, 0x85, 0x00, 0x00, 0x88,
|
|
/* 0x000188 - 0x00018f */ 0x00, 0x8a, 0x00, 0x8c, 0x00, 0x8e, 0xdd, 0x90,
|
|
/* 0x000190 - 0x000197 */ 0x00, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x000198 - 0x00019f */ 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x0001a0 - 0x0001a7 */ 0xa1, 0x00, 0xa3, 0x00, 0xa5, 0x00, 0x00, 0x00,
|
|
/* 0x0001a8 - 0x0001af */ 0xa9, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0xb0,
|
|
/* 0x0001b0 - 0x0001b7 */ 0x00, 0x00, 0x00, 0xb4, 0x00, 0xb6, 0x00, 0x00,
|
|
/* 0x0001b8 - 0x0001bf */ 0xb9, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00,
|
|
/* 0x0001c0 - 0x0001c7 */ 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0x00, 0xc9,
|
|
/* 0x0001c8 - 0x0001cf */ 0xc9, 0x00, 0xcc, 0xcc, 0x00, 0xce, 0x00, 0xd0,
|
|
/* 0x0001d0 - 0x0001d7 */ 0x00, 0xd2, 0x00, 0xd4, 0x00, 0xd6, 0x00, 0xd8,
|
|
/* 0x0001d8 - 0x0001df */ 0x00, 0xda, 0x00, 0xdc, 0x00, 0x00, 0xdf, 0x00,
|
|
/* 0x0001e0 - 0x0001e7 */ 0xe1, 0x00, 0xe3, 0x00, 0xe5, 0x00, 0xe7, 0x00,
|
|
/* 0x0001e8 - 0x0001ef */ 0xe9, 0x00, 0xeb, 0x00, 0xed, 0x00, 0xef, 0x00,
|
|
/* 0x0001f0 - 0x0001f7 */ 0x00, 0xf3, 0xf3, 0x00, 0xf5, 0x00, 0x95, 0x00,
|
|
/* 0x0001f8 - 0x0001ff */ 0xf9, 0x00, 0xfb, 0x00, 0xfd, 0x00, 0xff, 0x00,
|
|
#endif
|
|
};
|
|
|
|
#ifdef LATIN_EXTENDED_B_DISABLE
|
|
if (uc >= 0x0180) return uc;
|
|
#endif
|
|
|
|
unsigned char v = uc - 0x0100;
|
|
|
|
if (table[v]) return 0x0100 | table[v];
|
|
|
|
switch(v) { default: return uc;
|
|
case 0x78: return 0x00ff;
|
|
|
|
#if !defined(LATIN_EXTENDED_B_DISABLE) && !defined(IPA_EXTENSIONS_DISABLE)
|
|
case 0x81: return 0x0253;
|
|
case 0x86: return 0x0254;
|
|
case 0x90: return 0x025b;
|
|
case 0x93: return 0x0260;
|
|
case 0x94: return 0x0263;
|
|
case 0x96: return 0x0269;
|
|
case 0x97: return 0x0268;
|
|
case 0x9c: return 0x026f;
|
|
case 0x9d: return 0x0272;
|
|
case 0x9f: return 0x0275;
|
|
case 0xa6: return 0x0280;
|
|
case 0xa9: return 0x0283;
|
|
case 0xae: return 0x0288;
|
|
case 0xb1: return 0x028a;
|
|
case 0xb2: return 0x028b;
|
|
case 0xb7: return 0x0292;
|
|
case 0xbf: return 0x0259;
|
|
case 0xf7: return 0x02bf;
|
|
#endif
|
|
}
|
|
}
|
|
|
|
static unsigned int tolower_0200_024f(unsigned int uc) {
|
|
#ifndef LATIN_EXTENDED_B_DISABLE
|
|
static unsigned char table[] = {
|
|
/* 0x000200 - 0x000207 */ 0x01, 0x00, 0x03, 0x00, 0x05, 0x00, 0x07, 0x00,
|
|
/* 0x000208 - 0x00020f */ 0x09, 0x00, 0x0b, 0x00, 0x0d, 0x00, 0x0f, 0x00,
|
|
/* 0x000210 - 0x000217 */ 0x11, 0x00, 0x13, 0x00, 0x15, 0x00, 0x17, 0x00,
|
|
/* 0x000218 - 0x00021f */ 0x19, 0x00, 0x1b, 0x00, 0x1d, 0x00, 0x1f, 0x00,
|
|
/* 0x000220 - 0x000227 */ 0x00, 0x00, 0x23, 0x00, 0x25, 0x00, 0x27, 0x00,
|
|
/* 0x000228 - 0x00022f */ 0x29, 0x00, 0x2b, 0x00, 0x2d, 0x00, 0x2f, 0x00,
|
|
/* 0x000230 - 0x000237 */ 0x31, 0x00, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x000238 - 0x00023f */ 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3f, 0x00,
|
|
/* 0x000240 - 0x000247 */ 0x00, 0x42, 0x00, 0x00, 0x89, 0x8c, 0x47, 0x00,
|
|
/* 0x000248 - 0x00024f */ 0x49, 0x00, 0x4b, 0x00, 0x4d, 0x00, 0x4f, 0x00,
|
|
};
|
|
|
|
unsigned char v = uc - 0x0200;
|
|
|
|
if (table[v]) return 0x0200 | table[v];
|
|
|
|
switch(v) { default: break;
|
|
case 0x20: return 0x019e;
|
|
case 0x3d: return 0x019a;
|
|
case 0x43: return 0x0180;
|
|
|
|
#ifndef LATIN_EXTENDED_C_DISABLE
|
|
case 0x3a: return 0x2c65;
|
|
#endif
|
|
}
|
|
#endif
|
|
|
|
return uc;
|
|
}
|
|
|
|
static unsigned int tolower_0370_03ff(unsigned int uc) {
|
|
static unsigned char table[] = {
|
|
/* 0x000370 - 0x000377 */ 0x71, 0x00, 0x73, 0x00, 0x00, 0x00, 0x77, 0x00,
|
|
/* 0x000378 - 0x00037f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf3,
|
|
/* 0x000380 - 0x000387 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x00,
|
|
/* 0x000388 - 0x00038f */ 0xad, 0xae, 0xaf, 0x00, 0xcc, 0x00, 0xcd, 0xce,
|
|
/* 0x000390 - 0x000397 */ 0x00, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
|
|
/* 0x000398 - 0x00039f */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
|
|
/* 0x0003a0 - 0x0003a7 */ 0xc0, 0xc1, 0x00, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
|
|
/* 0x0003a8 - 0x0003af */ 0xc8, 0xc9, 0xca, 0xcb, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x0003b0 - 0x0003b7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x0003b8 - 0x0003bf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x0003c0 - 0x0003c7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x0003c8 - 0x0003cf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x0003d0 - 0x0003d7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x0003d8 - 0x0003df */ 0xd9, 0x00, 0xdb, 0x00, 0xdd, 0x00, 0xdf, 0x00,
|
|
/* 0x0003e0 - 0x0003e7 */ 0xe1, 0x00, 0xe3, 0x00, 0xe5, 0x00, 0xe7, 0x00,
|
|
/* 0x0003e8 - 0x0003ef */ 0xe9, 0x00, 0xeb, 0x00, 0xed, 0x00, 0xef, 0x00,
|
|
/* 0x0003f0 - 0x0003f7 */ 0x00, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0xf8,
|
|
/* 0x0003f8 - 0x0003ff */ 0x00, 0xf2, 0xfb, 0x00, 0x00, 0x7b, 0x7c, 0x7d,
|
|
};
|
|
|
|
unsigned char v = uc - 0x0370;
|
|
|
|
if (table[v]) return 0x0300 | table[v];
|
|
|
|
return uc;
|
|
}
|
|
|
|
static unsigned int tolower_0460_04ff(unsigned int uc) {
|
|
static unsigned char table[] = {
|
|
/* 0x000460 - 0x000467 */ 0x61, 0x00, 0x63, 0x00, 0x65, 0x00, 0x67, 0x00,
|
|
/* 0x000468 - 0x00046f */ 0x69, 0x00, 0x6b, 0x00, 0x6d, 0x00, 0x6f, 0x00,
|
|
/* 0x000470 - 0x000477 */ 0x71, 0x00, 0x73, 0x00, 0x75, 0x00, 0x77, 0x00,
|
|
/* 0x000478 - 0x00047f */ 0x79, 0x00, 0x7b, 0x00, 0x7d, 0x00, 0x7f, 0x00,
|
|
/* 0x000480 - 0x000487 */ 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x000488 - 0x00048f */ 0x00, 0x00, 0x8b, 0x00, 0x8d, 0x00, 0x8f, 0x00,
|
|
/* 0x000490 - 0x000497 */ 0x91, 0x00, 0x93, 0x00, 0x95, 0x00, 0x97, 0x00,
|
|
/* 0x000498 - 0x00049f */ 0x99, 0x00, 0x9b, 0x00, 0x9d, 0x00, 0x9f, 0x00,
|
|
/* 0x0004a0 - 0x0004a7 */ 0xa1, 0x00, 0xa3, 0x00, 0xa5, 0x00, 0xa7, 0x00,
|
|
/* 0x0004a8 - 0x0004af */ 0xa9, 0x00, 0xab, 0x00, 0xad, 0x00, 0xaf, 0x00,
|
|
/* 0x0004b0 - 0x0004b7 */ 0xb1, 0x00, 0xb3, 0x00, 0xb5, 0x00, 0xb7, 0x00,
|
|
/* 0x0004b8 - 0x0004bf */ 0xb9, 0x00, 0xbb, 0x00, 0xbd, 0x00, 0xbf, 0x00,
|
|
/* 0x0004c0 - 0x0004c7 */ 0xcf, 0xc2, 0x00, 0xc4, 0x00, 0xc6, 0x00, 0xc8,
|
|
/* 0x0004c8 - 0x0004cf */ 0x00, 0xca, 0x00, 0xcc, 0x00, 0xce, 0x00, 0x00,
|
|
/* 0x0004d0 - 0x0004d7 */ 0xd1, 0x00, 0xd3, 0x00, 0xd5, 0x00, 0xd7, 0x00,
|
|
/* 0x0004d8 - 0x0004df */ 0xd9, 0x00, 0xdb, 0x00, 0xdd, 0x00, 0xdf, 0x00,
|
|
/* 0x0004e0 - 0x0004e7 */ 0xe1, 0x00, 0xe3, 0x00, 0xe5, 0x00, 0xe7, 0x00,
|
|
/* 0x0004e8 - 0x0004ef */ 0xe9, 0x00, 0xeb, 0x00, 0xed, 0x00, 0xef, 0x00,
|
|
/* 0x0004f0 - 0x0004f7 */ 0xf1, 0x00, 0xf3, 0x00, 0xf5, 0x00, 0xf7, 0x00,
|
|
/* 0x0004f8 - 0x0004ff */ 0xf9, 0x00, 0xfb, 0x00, 0xfd, 0x00, 0xff, 0x00,
|
|
};
|
|
|
|
unsigned char v = uc - 0x0460;
|
|
|
|
if (table[v]) return 0x0400 | table[v];
|
|
|
|
return uc;
|
|
}
|
|
|
|
static unsigned int tolower_0500_055f(unsigned int uc) {
|
|
static unsigned char table[] = {
|
|
#ifndef CYRILLIC_SUPLEMENT_DISABLE
|
|
/* 0x000500 - 0x000507 */ 0x01, 0x00, 0x03, 0x00, 0x05, 0x00, 0x07, 0x00,
|
|
/* 0x000508 - 0x00050f */ 0x09, 0x00, 0x0b, 0x00, 0x0d, 0x00, 0x0f, 0x00,
|
|
/* 0x000510 - 0x000517 */ 0x11, 0x00, 0x13, 0x00, 0x15, 0x00, 0x17, 0x00,
|
|
/* 0x000518 - 0x00051f */ 0x19, 0x00, 0x1b, 0x00, 0x1d, 0x00, 0x1f, 0x00,
|
|
/* 0x000520 - 0x000527 */ 0x21, 0x00, 0x23, 0x00, 0x25, 0x00, 0x27, 0x00,
|
|
/* 0x000528 - 0x00052f */ 0x29, 0x00, 0x2b, 0x00, 0x2d, 0x00, 0x2f, 0x00,
|
|
#endif
|
|
/* 0x000530 - 0x000537 */ 0x00, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
|
|
/* 0x000538 - 0x00053f */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
|
|
/* 0x000540 - 0x000547 */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
|
|
/* 0x000548 - 0x00054f */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
|
|
/* 0x000550 - 0x000557 */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x00,
|
|
};
|
|
|
|
#ifndef CYRILLIC_SUPLEMENT_DISABLE
|
|
unsigned char v = uc - 0x0500;
|
|
#else
|
|
if (uc <= 0x052f) return uc;
|
|
|
|
unsigned char v = uc - 0x0530;
|
|
#endif
|
|
if (table[v]) return 0x0500 | table[v];
|
|
|
|
return uc;
|
|
}
|
|
|
|
static unsigned int tolower_10a0_10cf(unsigned int uc) {
|
|
static unsigned char table[] = {
|
|
/* 0x0010a0 - 0x0010a7 */ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
|
|
/* 0x0010a8 - 0x0010af */ 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
|
|
/* 0x0010b0 - 0x0010b7 */ 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
|
|
/* 0x0010b8 - 0x0010bf */ 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
|
|
/* 0x0010c0 - 0x0010c7 */ 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x00, 0x28,
|
|
/* 0x0010c8 - 0x0010cf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00,
|
|
};
|
|
|
|
unsigned char v = uc - 0x10a0;
|
|
|
|
if (table[v]) return 0x2d00 | table[v] - 1;
|
|
|
|
return uc;
|
|
}
|
|
|
|
static unsigned int tolower_13a0_13ff(unsigned int uc) {
|
|
#ifndef CHEROKEE_DISABLE
|
|
static unsigned char table[] = {
|
|
/* 0x0013a0 - 0x0013a7 */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
|
|
/* 0x0013a8 - 0x0013af */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
|
|
/* 0x0013b0 - 0x0013b7 */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
|
|
/* 0x0013b8 - 0x0013bf */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
|
|
/* 0x0013c0 - 0x0013c7 */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
|
|
/* 0x0013c8 - 0x0013cf */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
|
|
/* 0x0013d0 - 0x0013d7 */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
|
|
/* 0x0013d8 - 0x0013df */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
|
|
/* 0x0013e0 - 0x0013e7 */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
|
|
/* 0x0013e8 - 0x0013ef */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
|
|
/* 0x0013f0 - 0x0013f7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0x00, 0x00,
|
|
};
|
|
|
|
unsigned char v = uc - 0x13a0;
|
|
|
|
if (v <= 0x4f) {
|
|
if (table[v]) return 0xab00 | table[v];
|
|
} else if (v <= 0x57) {
|
|
if (table[v]) return 0x1300 | table[v];
|
|
}
|
|
#endif
|
|
|
|
return uc;
|
|
}
|
|
|
|
static unsigned int tolower_1c90_1cbf(unsigned int uc) {
|
|
static unsigned char table[] = {
|
|
/* 0x001c90 - 0x001c97 */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
|
|
/* 0x001c98 - 0x001c9f */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
|
|
/* 0x001ca0 - 0x001ca7 */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
|
|
/* 0x001ca8 - 0x001caf */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
|
|
/* 0x001cb0 - 0x001cb7 */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
|
|
/* 0x001cb8 - 0x001cbf */ 0xf8, 0xf9, 0xfa, 0x00, 0x00, 0xfd, 0xfe, 0xff,
|
|
};
|
|
|
|
unsigned char v = uc - 0x1c90;
|
|
|
|
if (table[v]) return 0x1000 | table[v];
|
|
|
|
return uc;
|
|
}
|
|
|
|
static unsigned int tolower_1e00_1eff(unsigned int uc) {
|
|
#ifndef LATIN_EXTENDED_ADDITIONAL_DISABLE
|
|
static unsigned char table[] = {
|
|
/* 0x001e00 - 0x001e07 */ 0x01, 0x00, 0x03, 0x00, 0x05, 0x00, 0x07, 0x00,
|
|
/* 0x001e08 - 0x001e0f */ 0x09, 0x00, 0x0b, 0x00, 0x0d, 0x00, 0x0f, 0x00,
|
|
/* 0x001e10 - 0x001e17 */ 0x11, 0x00, 0x13, 0x00, 0x15, 0x00, 0x17, 0x00,
|
|
/* 0x001e18 - 0x001e1f */ 0x19, 0x00, 0x1b, 0x00, 0x1d, 0x00, 0x1f, 0x00,
|
|
/* 0x001e20 - 0x001e27 */ 0x21, 0x00, 0x23, 0x00, 0x25, 0x00, 0x27, 0x00,
|
|
/* 0x001e28 - 0x001e2f */ 0x29, 0x00, 0x2b, 0x00, 0x2d, 0x00, 0x2f, 0x00,
|
|
/* 0x001e30 - 0x001e37 */ 0x31, 0x00, 0x33, 0x00, 0x35, 0x00, 0x37, 0x00,
|
|
/* 0x001e38 - 0x001e3f */ 0x39, 0x00, 0x3b, 0x00, 0x3d, 0x00, 0x3f, 0x00,
|
|
/* 0x001e40 - 0x001e47 */ 0x41, 0x00, 0x43, 0x00, 0x45, 0x00, 0x47, 0x00,
|
|
/* 0x001e48 - 0x001e4f */ 0x49, 0x00, 0x4b, 0x00, 0x4d, 0x00, 0x4f, 0x00,
|
|
/* 0x001e50 - 0x001e57 */ 0x51, 0x00, 0x53, 0x00, 0x55, 0x00, 0x57, 0x00,
|
|
/* 0x001e58 - 0x001e5f */ 0x59, 0x00, 0x5b, 0x00, 0x5d, 0x00, 0x5f, 0x00,
|
|
/* 0x001e60 - 0x001e67 */ 0x61, 0x00, 0x63, 0x00, 0x65, 0x00, 0x67, 0x00,
|
|
/* 0x001e68 - 0x001e6f */ 0x69, 0x00, 0x6b, 0x00, 0x6d, 0x00, 0x6f, 0x00,
|
|
/* 0x001e70 - 0x001e77 */ 0x71, 0x00, 0x73, 0x00, 0x75, 0x00, 0x77, 0x00,
|
|
/* 0x001e78 - 0x001e7f */ 0x79, 0x00, 0x7b, 0x00, 0x7d, 0x00, 0x7f, 0x00,
|
|
/* 0x001e80 - 0x001e87 */ 0x81, 0x00, 0x83, 0x00, 0x85, 0x00, 0x87, 0x00,
|
|
/* 0x001e88 - 0x001e8f */ 0x89, 0x00, 0x8b, 0x00, 0x8d, 0x00, 0x8f, 0x00,
|
|
/* 0x001e90 - 0x001e97 */ 0x91, 0x00, 0x93, 0x00, 0x95, 0x00, 0x00, 0x00,
|
|
/* 0x001e98 - 0x001e9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x001ea0 - 0x001ea7 */ 0xa1, 0x00, 0xa3, 0x00, 0xa5, 0x00, 0xa7, 0x00,
|
|
/* 0x001ea8 - 0x001eaf */ 0xa9, 0x00, 0xab, 0x00, 0xad, 0x00, 0xaf, 0x00,
|
|
/* 0x001eb0 - 0x001eb7 */ 0xb1, 0x00, 0xb3, 0x00, 0xb5, 0x00, 0xb7, 0x00,
|
|
/* 0x001eb8 - 0x001ebf */ 0xb9, 0x00, 0xbb, 0x00, 0xbd, 0x00, 0xbf, 0x00,
|
|
/* 0x001ec0 - 0x001ec7 */ 0xc1, 0x00, 0xc3, 0x00, 0xc5, 0x00, 0xc7, 0x00,
|
|
/* 0x001ec8 - 0x001ecf */ 0xc9, 0x00, 0xcb, 0x00, 0xcd, 0x00, 0xcf, 0x00,
|
|
/* 0x001ed0 - 0x001ed7 */ 0xd1, 0x00, 0xd3, 0x00, 0xd5, 0x00, 0xd7, 0x00,
|
|
/* 0x001ed8 - 0x001edf */ 0xd9, 0x00, 0xdb, 0x00, 0xdd, 0x00, 0xdf, 0x00,
|
|
/* 0x001ee0 - 0x001ee7 */ 0xe1, 0x00, 0xe3, 0x00, 0xe5, 0x00, 0xe7, 0x00,
|
|
/* 0x001ee8 - 0x001eef */ 0xe9, 0x00, 0xeb, 0x00, 0xed, 0x00, 0xef, 0x00,
|
|
/* 0x001ef0 - 0x001ef7 */ 0xf1, 0x00, 0xf3, 0x00, 0xf5, 0x00, 0xf7, 0x00,
|
|
/* 0x001ef8 - 0x001eff */ 0xf9, 0x00, 0xfb, 0x00, 0xfd, 0x00, 0xff, 0x00,
|
|
};
|
|
|
|
unsigned char v = uc - 0x1e00;
|
|
|
|
if (table[v]) return 0x1e00 | table[v];
|
|
|
|
switch (v) { default: break;
|
|
case 0x9e: return 0xdf;
|
|
}
|
|
#endif
|
|
|
|
return uc;
|
|
}
|
|
|
|
static unsigned int tolower_1f00_1fff(unsigned int uc) {
|
|
#ifndef GREEK_EXTENDED_DISABLE
|
|
static unsigned char table[] = {
|
|
/* 0x001f00 - 0x001f07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x001f08 - 0x001f0f */ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
|
|
/* 0x001f10 - 0x001f17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x001f18 - 0x001f1f */ 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x00, 0x00,
|
|
/* 0x001f20 - 0x001f27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x001f28 - 0x001f2f */ 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
|
|
/* 0x001f30 - 0x001f37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x001f38 - 0x001f3f */ 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
|
|
/* 0x001f40 - 0x001f47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x001f48 - 0x001f4f */ 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x00, 0x00,
|
|
/* 0x001f50 - 0x001f57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x001f58 - 0x001f5f */ 0x00, 0x52, 0x00, 0x54, 0x00, 0x56, 0x00, 0x58,
|
|
/* 0x001f60 - 0x001f67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x001f68 - 0x001f6f */ 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
|
|
/* 0x001f70 - 0x001f77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x001f78 - 0x001f7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x001f80 - 0x001f87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x001f88 - 0x001f8f */ 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88,
|
|
/* 0x001f90 - 0x001f97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x001f98 - 0x001f9f */ 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
|
|
/* 0x001fa0 - 0x001fa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x001fa8 - 0x001faf */ 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8,
|
|
/* 0x001fb0 - 0x001fb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x001fb8 - 0x001fbf */ 0xb1, 0xb2, 0x71, 0x72, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x001fc0 - 0x001fc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x001fc8 - 0x001fcf */ 0x73, 0x74, 0x75, 0x76, 0xc4, 0x00, 0x00, 0x00,
|
|
/* 0x001fd0 - 0x001fd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x001fd8 - 0x001fdf */ 0xd1, 0xd2, 0x77, 0x78, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x001fe0 - 0x001fe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x001fe8 - 0x001fef */ 0xe1, 0xe2, 0x7b, 0x7c, 0xe6, 0x00, 0x00, 0x00,
|
|
/* 0x001ff0 - 0x001ff7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x001ff8 - 0x001fff */ 0x79, 0x7a, 0x7d, 0x7e, 0xf4, 0x00, 0x00, 0x00,
|
|
};
|
|
|
|
unsigned char v = uc - 0x1f00;
|
|
|
|
if (table[v]) return 0x1f00 | table[v] - 1;
|
|
#endif
|
|
|
|
return uc;
|
|
}
|
|
|
|
static unsigned int tolower_2c00_2cff(unsigned int uc) {
|
|
|
|
#if !defined(GLAGOLITIC_DISABLE) || !defined(LATIN_EXTENDED_C_DISABLE) || !defined(COPTIC_DISABLE)
|
|
#ifndef GLAGOLITIC_DISABLE
|
|
static unsigned char table_2c00[] = {
|
|
/* 0x002c00 - 0x002c07 */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
|
|
/* 0x002c08 - 0x002c0f */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
|
|
/* 0x002c10 - 0x002c17 */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
|
|
/* 0x002c18 - 0x002c1f */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
|
|
/* 0x002c20 - 0x002c27 */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
|
|
/* 0x002c28 - 0x002c2f */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x00,
|
|
};
|
|
#endif
|
|
|
|
static unsigned char table_2c60[] = {
|
|
#ifndef LATIN_EXTENDED_C_DISABLE
|
|
/* 0x002c60 - 0x002c67 */ 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68,
|
|
/* 0x002c68 - 0x002c6f */ 0x00, 0x6a, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x002c70 - 0x002c77 */ 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x002c78 - 0x002c7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
#endif
|
|
#ifndef COPTIC_DISABLE
|
|
/* 0x002c80 - 0x002c87 */ 0x81, 0x00, 0x83, 0x00, 0x85, 0x00, 0x87, 0x00,
|
|
/* 0x002c88 - 0x002c8f */ 0x89, 0x00, 0x8b, 0x00, 0x8d, 0x00, 0x8f, 0x00,
|
|
/* 0x002c90 - 0x002c97 */ 0x91, 0x00, 0x93, 0x00, 0x95, 0x00, 0x97, 0x00,
|
|
/* 0x002c98 - 0x002c9f */ 0x99, 0x00, 0x9b, 0x00, 0x9d, 0x00, 0x9f, 0x00,
|
|
/* 0x002ca0 - 0x002ca7 */ 0xa1, 0x00, 0xa3, 0x00, 0xa5, 0x00, 0xa7, 0x00,
|
|
/* 0x002ca8 - 0x002caf */ 0xa9, 0x00, 0xab, 0x00, 0xad, 0x00, 0xaf, 0x00,
|
|
/* 0x002cb0 - 0x002cb7 */ 0xb1, 0x00, 0xb3, 0x00, 0xb5, 0x00, 0xb7, 0x00,
|
|
/* 0x002cb8 - 0x002cbf */ 0xb9, 0x00, 0xbb, 0x00, 0xbd, 0x00, 0xbf, 0x00,
|
|
/* 0x002cc0 - 0x002cc7 */ 0xc1, 0x00, 0xc3, 0x00, 0xc5, 0x00, 0xc7, 0x00,
|
|
/* 0x002cc8 - 0x002ccf */ 0xc9, 0x00, 0xcb, 0x00, 0xcd, 0x00, 0xcf, 0x00,
|
|
/* 0x002cd0 - 0x002cd7 */ 0xd1, 0x00, 0xd3, 0x00, 0xd5, 0x00, 0xd7, 0x00,
|
|
/* 0x002cd8 - 0x002cdf */ 0xd9, 0x00, 0xdb, 0x00, 0xdd, 0x00, 0xdf, 0x00,
|
|
/* 0x002ce0 - 0x002ce7 */ 0xe1, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x002ce8 - 0x002cef */ 0x00, 0x00, 0x00, 0xec, 0x00, 0xee, 0x00, 0x00,
|
|
/* 0x002cf0 - 0x002cf7 */ 0x00, 0x00, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
#endif
|
|
};
|
|
|
|
unsigned char v = uc - 0x002c00;
|
|
|
|
if (v <= 0x2f) {
|
|
#ifndef GLAGOLITIC_DISABLE
|
|
if (table_2c00[v]) return 0x2c00 | table_2c00[v];
|
|
#endif
|
|
} else if (v >= 0x60) {
|
|
|
|
#if !defined(LATIN_EXTENDED_C_DISABLE)
|
|
#if defined(COPTIC_DISABLE)
|
|
if (uc >= 0x2c80) return uc;
|
|
#endif
|
|
if (table_2c60[v -= 0x60]) return 0x2c00 | table_2c60[v];
|
|
#elif defined(LATIN_EXTENDED_C_DISABLE) &&!defined(COPTIC_DISABLE)
|
|
if (uc <= 0x2c7f) return uc;
|
|
if (table_2c60[v -= 0x80]) return 0x2c00 | table_2c60[v];
|
|
#endif
|
|
|
|
#if !defined(LATIN_EXTENDED_C_DISABLE)
|
|
switch (v) { default: break;
|
|
|
|
#if !defined(PHONETIC_EXTENSIONS_DISABLE)
|
|
case 0x03: return 0x001d7d;
|
|
#endif
|
|
#ifndef LATIN_EXTENDED_B_DISABLE
|
|
case 0x02: return 0x00026b;
|
|
case 0x04: return 0x00027d;
|
|
case 0x0d: return 0x000251;
|
|
case 0x0e: return 0x000271;
|
|
case 0x0f: return 0x000250;
|
|
case 0x10: return 0x000252;
|
|
case 0x1e: return 0x00023f;
|
|
case 0x1f: return 0x000240;
|
|
#endif
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
return uc;
|
|
}
|
|
|
|
static unsigned int tolower_a640_a69f(unsigned int uc) {
|
|
#ifndef CYRILLIC_EXTENDED_B_DISABLE
|
|
static unsigned char table[] = {
|
|
/* 0x00a640 - 0x00a647 */ 0x41, 0x00, 0x43, 0x00, 0x45, 0x00, 0x47, 0x00,
|
|
/* 0x00a648 - 0x00a64f */ 0x49, 0x00, 0x4b, 0x00, 0x4d, 0x00, 0x4f, 0x00,
|
|
/* 0x00a650 - 0x00a657 */ 0x51, 0x00, 0x53, 0x00, 0x55, 0x00, 0x57, 0x00,
|
|
/* 0x00a658 - 0x00a65f */ 0x59, 0x00, 0x5b, 0x00, 0x5d, 0x00, 0x5f, 0x00,
|
|
/* 0x00a660 - 0x00a667 */ 0x61, 0x00, 0x63, 0x00, 0x65, 0x00, 0x67, 0x00,
|
|
/* 0x00a668 - 0x00a66f */ 0x69, 0x00, 0x6b, 0x00, 0x6d, 0x00, 0x00, 0x00,
|
|
/* 0x00a670 - 0x00a677 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x00a678 - 0x00a67f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x00a680 - 0x00a687 */ 0x81, 0x00, 0x83, 0x00, 0x85, 0x00, 0x87, 0x00,
|
|
/* 0x00a688 - 0x00a68f */ 0x89, 0x00, 0x8b, 0x00, 0x8d, 0x00, 0x8f, 0x00,
|
|
/* 0x00a690 - 0x00a697 */ 0x91, 0x00, 0x93, 0x00, 0x95, 0x00, 0x97, 0x00,
|
|
/* 0x00a698 - 0x00a69f */ 0x99, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
};
|
|
|
|
unsigned char v = uc - 0xa640;
|
|
|
|
if (table[v]) return 0xa600 | table[v];
|
|
#endif
|
|
|
|
return uc;
|
|
}
|
|
|
|
static unsigned int tolower_a720_a7cf(unsigned int uc) {
|
|
#ifndef LATIN_EXTENDED_D_DISABLE
|
|
static unsigned char table[] = {
|
|
/* 0x00a720 - 0x00a727 */ 0x00, 0x00, 0x23, 0x00, 0x25, 0x00, 0x27, 0x00,
|
|
/* 0x00a728 - 0x00a72f */ 0x29, 0x00, 0x2b, 0x00, 0x2d, 0x00, 0x2f, 0x00,
|
|
/* 0x00a730 - 0x00a737 */ 0x00, 0x00, 0x33, 0x00, 0x35, 0x00, 0x37, 0x00,
|
|
/* 0x00a738 - 0x00a73f */ 0x39, 0x00, 0x3b, 0x00, 0x3d, 0x00, 0x3f, 0x00,
|
|
/* 0x00a740 - 0x00a747 */ 0x41, 0x00, 0x43, 0x00, 0x45, 0x00, 0x47, 0x00,
|
|
/* 0x00a748 - 0x00a74f */ 0x49, 0x00, 0x4b, 0x00, 0x4d, 0x00, 0x4f, 0x00,
|
|
/* 0x00a750 - 0x00a757 */ 0x51, 0x00, 0x53, 0x00, 0x55, 0x00, 0x57, 0x00,
|
|
/* 0x00a758 - 0x00a75f */ 0x59, 0x00, 0x5b, 0x00, 0x5d, 0x00, 0x5f, 0x00,
|
|
/* 0x00a760 - 0x00a767 */ 0x61, 0x00, 0x63, 0x00, 0x65, 0x00, 0x67, 0x00,
|
|
/* 0x00a768 - 0x00a76f */ 0x69, 0x00, 0x6b, 0x00, 0x6d, 0x00, 0x6f, 0x00,
|
|
/* 0x00a770 - 0x00a777 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x00a778 - 0x00a77f */ 0x00, 0x7a, 0x00, 0x7c, 0x00, 0x00, 0x7f, 0x00,
|
|
/* 0x00a780 - 0x00a787 */ 0x81, 0x00, 0x83, 0x00, 0x85, 0x00, 0x87, 0x00,
|
|
/* 0x00a788 - 0x00a78f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x00a790 - 0x00a797 */ 0x91, 0x00, 0x93, 0x00, 0x00, 0x00, 0x97, 0x00,
|
|
/* 0x00a798 - 0x00a79f */ 0x99, 0x00, 0x9b, 0x00, 0x9d, 0x00, 0x9f, 0x00,
|
|
/* 0x00a7a0 - 0x00a7a7 */ 0xa1, 0x00, 0xa3, 0x00, 0xa5, 0x00, 0xa7, 0x00,
|
|
/* 0x00a7a8 - 0x00a7af */ 0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
/* 0x00a7b0 - 0x00a7b7 */ 0x00, 0x00, 0x00, 0x00, 0xb5, 0x00, 0xb7, 0x00,
|
|
/* 0x00a7b8 - 0x00a7bf */ 0xb9, 0x00, 0xbb, 0x00, 0xbd, 0x00, 0xbf, 0x00,
|
|
/* 0x00a7c0 - 0x00a7c7 */ 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x00, 0xc8,
|
|
/* 0x00a7c8 - 0x00a7cf */ 0x00, 0xca, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
};
|
|
|
|
unsigned char v = uc - 0xa720;
|
|
|
|
if (table[v]) return 0xa700 | table[v];
|
|
|
|
switch (v) { default: break;
|
|
|
|
#ifndef PHONETIC_EXTENSIONS_DISABLE
|
|
case 0x5d: return 0x001d79;
|
|
#endif
|
|
#ifndef LATIN_EXTENDED_B_DISABLE
|
|
case 0x6d: return 0x000265;
|
|
case 0x8a: return 0x000266;
|
|
case 0x8b: return 0x00025c;
|
|
case 0x8c: return 0x000261;
|
|
case 0x8d: return 0x00026c;
|
|
case 0x8e: return 0x00026a;
|
|
case 0x90: return 0x00029e;
|
|
case 0x91: return 0x000287;
|
|
case 0x92: return 0x00029d;
|
|
#endif
|
|
#ifndef LATIN_EXTENDED_E_DISABLE
|
|
case 0x93: return 0x00ab53;
|
|
#endif
|
|
}
|
|
#endif
|
|
|
|
return uc;
|
|
}
|
|
|
|
|
|
|
|
static unsigned int tolower_010400_0104df(unsigned int uc) {
|
|
#ifndef DESERET_DISABLE
|
|
static unsigned char table_0400[] = {
|
|
/* 0x010400 - 0x010407 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
|
|
/* 0x010408 - 0x01040f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
|
|
/* 0x010410 - 0x010417 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
|
|
/* 0x010418 - 0x01041f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
|
|
/* 0x010420 - 0x010427 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
|
|
};
|
|
#endif
|
|
|
|
#ifndef OSAGE_DISABLE
|
|
static unsigned char table_04b0[] = {
|
|
/* 0x0104b0 - 0x0104b7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
|
|
/* 0x0104b8 - 0x0104bf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
|
|
/* 0x0104c0 - 0x0104c7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
|
|
/* 0x0104c8 - 0x0104cf */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
|
|
/* 0x0104d0 - 0x0104d7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0x00, 0x00, 0x00,
|
|
};
|
|
#endif
|
|
|
|
unsigned char v = uc - 0x010400;
|
|
|
|
if (v <= 0x27) {
|
|
#ifndef DESERET_DISABLE
|
|
if (table_0400[v]) return 0x010400 | table_0400[v];
|
|
#endif
|
|
} else if (v >= 0xb0 && v <= 0xd7) {
|
|
#ifndef OSAGE_DISABLE
|
|
if (table_04b0[v -= 0xb0]) return 0x010400 | table_04b0[v];
|
|
#endif
|
|
}
|
|
|
|
return uc;
|
|
}
|
|
|
|
static unsigned int tolower_010c80_010cbf(unsigned int uc) {
|
|
#ifndef OLD_HUNGARIAN_DISABLE
|
|
static unsigned char table[] = {
|
|
/* 0x010c80 - 0x010c87 */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
|
|
/* 0x010c88 - 0x010c8f */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
|
|
/* 0x010c90 - 0x010c97 */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
|
|
/* 0x010c98 - 0x010c9f */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
|
|
/* 0x010ca0 - 0x010ca7 */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
|
|
/* 0x010ca8 - 0x010caf */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
|
|
/* 0x010cb0 - 0x010cb7 */ 0xf0, 0xf1, 0xf2, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
};
|
|
|
|
if (uc <= 0x010cb7) {
|
|
unsigned char v = uc - 0x010c80;
|
|
|
|
if (table[v]) return 0x010c00 | table[v];
|
|
}
|
|
#endif
|
|
|
|
return uc;
|
|
}
|
|
|
|
static unsigned int tolower_0118a0_0118bf(unsigned int uc) {
|
|
#ifndef WARANG_CITI_DISABLE
|
|
static unsigned char table[] = {
|
|
/* 0x0118a0 - 0x0118a7 */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
|
|
/* 0x0118a8 - 0x0118af */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
|
|
/* 0x0118b0 - 0x0118b7 */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
|
|
/* 0x0118b8 - 0x0118bf */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
|
|
};
|
|
|
|
unsigned char v = uc - 0x0118a0;
|
|
|
|
return 0x011800 | table[v];
|
|
#else
|
|
return uc;
|
|
#endif
|
|
}
|
|
|
|
|
|
|
|
unsigned int tolower_unicode(unsigned int uc) {
|
|
|
|
if (uc <= 0x005a) return (uc >= 0x0041) ? uc | 0x20 : uc;
|
|
|
|
if (uc <= 0x042f) {
|
|
if (uc >= 0x0410) return uc + 0x20;
|
|
if (uc >= 0x0400) return uc + 0x50;
|
|
|
|
if (uc <= 0x00df) return (uc >= 0x00c0) ? tolower_00c0_00df(uc) : uc;
|
|
if (uc <= 0x01ff) return (uc >= 0x0100) ? tolower_0100_01ff(uc) : uc;
|
|
if (uc <= 0x024f) return (uc >= 0x0200) ? tolower_0200_024f(uc) : uc;
|
|
if (uc <= 0x03ff) return (uc >= 0x0370) ? tolower_0370_03ff(uc) : uc;
|
|
|
|
return uc;
|
|
}
|
|
|
|
if (uc <= 0x04ff && uc >= 0x0460) return tolower_0460_04ff(uc);
|
|
if (uc <= 0x055f && uc >= 0x0500) return tolower_0500_055f(uc);
|
|
if (uc <= 0x10cf && uc >= 0x10a0) return tolower_10a0_10cf(uc);
|
|
if (uc <= 0x13ff && uc >= 0x13a0) return tolower_13a0_13ff(uc);
|
|
if (uc <= 0x1cbf && uc >= 0x1c90) return tolower_1c90_1cbf(uc);
|
|
if (uc <= 0x1eff && uc >= 0x1e00) return tolower_1e00_1eff(uc);
|
|
if (uc <= 0x1fff && uc >= 0x1f00) return tolower_1f00_1fff(uc);
|
|
if (uc <= 0x2cff && uc >= 0x2c00) return tolower_2c00_2cff(uc);
|
|
if (uc <= 0xa69f && uc >= 0xa640) return tolower_a640_a69f(uc);
|
|
if (uc <= 0xa7cf && uc >= 0xa720) return tolower_a720_a7cf(uc);
|
|
|
|
if (uc <= 0x0104df && uc >= 0x010400) return tolower_010400_0104df(uc);
|
|
if (uc <= 0x010cbf && uc >= 0x010c80) return tolower_010c80_010cbf(uc);
|
|
if (uc <= 0x0118bf && uc >= 0x0118a0) return tolower_0118a0_0118bf(uc);
|
|
|
|
return uc;
|
|
}
|