diff options
author | jozan <jozan@noemail.net> | 2020-11-12 19:33:26 +0000 |
---|---|---|
committer | jozan <jozan@noemail.net> | 2020-11-12 19:33:26 +0000 |
commit | ff8fadf863431873e26a11814d65cbab48799038 (patch) | |
tree | 5e042e6f88a7a6e346fd68c8a991b862b3889888 /src/c_subst.c | |
parent | Unicode in progress (diff) | |
download | unixize-ff8fadf863431873e26a11814d65cbab48799038.tar.gz unixize-ff8fadf863431873e26a11814d65cbab48799038.tar.bz2 unixize-ff8fadf863431873e26a11814d65cbab48799038.tar.xz unixize-ff8fadf863431873e26a11814d65cbab48799038.tar.zst unixize-ff8fadf863431873e26a11814d65cbab48799038.zip |
More unicode to come
FossilOrigin-Name: ff529030371279eaac4d47324b6387112e0e6ca1d83db09af19f9182771b87fc
Diffstat (limited to 'src/c_subst.c')
-rw-r--r-- | src/c_subst.c | 73 |
1 files changed, 56 insertions, 17 deletions
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++; } |