From ff8fadf863431873e26a11814d65cbab48799038 Mon Sep 17 00:00:00 2001 From: jozan Date: Thu, 12 Nov 2020 19:33:26 +0000 Subject: More unicode to come FossilOrigin-Name: ff529030371279eaac4d47324b6387112e0e6ca1d83db09af19f9182771b87fc --- src/c_subst.c | 73 +++++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 56 insertions(+), 17 deletions(-) (limited to 'src/c_subst.c') diff --git a/src/c_subst.c b/src/c_subst.c index cc9823c..31c2cde 100644 --- a/src/c_subst.c +++ b/src/c_subst.c @@ -208,11 +208,37 @@ c_unicode_subst(char filename[]) p = (unsigned char*)filename; while (*p != 0x00) { + if (*p == 0xc2) { + if (*(p + 1) == 0xb9) { + *p = '1'; + memmove( + p + 1, + p + 2, + (strlen((const char*)p + 2) + 1) * sizeof(char) + ); + c_unicode_subst(filename); + } + if (*(p + 1) == 0xb2) { + *p = '2'; + memmove( + p + 1, + p + 2, + (strlen((const char*)p + 2) + 1) * sizeof(char) + ); + c_unicode_subst(filename); + } + if (*(p + 1) == 0xb3) { + *p = '3'; + memmove( + p + 1, + p + 2, + (strlen((const char*)p + 2) + 1) * sizeof(char) + ); + c_unicode_subst(filename); + } + } if (*p == 0xc3) { - if ( - u_isucharset((unsigned char)*(p + 1), C_CHARSET_A_MAJ) == TRUE || - u_isucharset((unsigned char)*(p + 1), C_CHARSET_A_MIN) == TRUE - ) { + if (u_isucharset((unsigned char)*(p + 1), C_CHARSET_A) == TRUE) { *p = 'a'; memmove( p + 1, @@ -221,10 +247,7 @@ c_unicode_subst(char filename[]) ); c_unicode_subst(filename); } - if ( - u_isucharset((unsigned char)*(p + 1), C_CHARSET_O_MAJ) == TRUE || - u_isucharset((unsigned char)*(p + 1), C_CHARSET_O_MIN) == TRUE - ) { + if (u_isucharset((unsigned char)*(p + 1), C_CHARSET_O) == TRUE) { *p = 'o'; memmove( p + 1, @@ -246,26 +269,42 @@ c_unicode_subst(char filename[]) (strlen((const char*)p + 2) + 1) * sizeof(char) ); c_unicode_subst(filename); - } - if (*(p + 1) == 0x72) { - *p = '2'; + } + if (u_isucharset((unsigned char)*(p + 1), C_CHARSET_DH) == TRUE) { + *p = 'd'; + *(p + 1) = 'h'; + c_unicode_subst(filename); + } + if (u_isucharset((unsigned char)*(p + 1), C_CHARSET_C) == TRUE) { + *p = 'c'; memmove( p + 1, p + 2, (strlen((const char*)p + 2) + 1) * sizeof(char) ); c_unicode_subst(filename); - } - if (*(p + 1) == 0x73) { - *p = '3'; + } + if (u_isucharset((unsigned char)*(p + 1), C_CHARSET_E) == TRUE) { + *p = 'e'; + memmove( + p + 1, + p + 2, + (strlen((const char*)p + 2) + 1) * sizeof(char) + ); + c_unicode_subst(filename); + } + if (u_isucharset((unsigned char)*(p + 1), C_CHARSET_U) == TRUE) { + *p = 'u'; memmove( p + 1, p + 2, (strlen((const char*)p + 2) + 1) * sizeof(char) ); c_unicode_subst(filename); - } - if (*(p + 1) == 0x75) { + } + } + if (*p == 0xce) { + if (*(p + 1) == 0xbc) { *p = 'u'; memmove( p + 1, @@ -273,7 +312,7 @@ c_unicode_subst(char filename[]) (strlen((const char*)p + 2) + 1) * sizeof(char) ); c_unicode_subst(filename); - } + } } p++; } -- cgit v1.2.3