aboutsummaryrefslogtreecommitdiffstats
path: root/src/c_subst.c
diff options
context:
space:
mode:
authorjozan <jozan@noemail.net>2020-11-12 19:02:18 +0000
committerjozan <jozan@noemail.net>2020-11-12 19:02:18 +0000
commitff28ca95c0744bbcd30536faa169a12b1fbe5b32 (patch)
tree54e2ee2540544e8793ce313f20091da893ef3fe7 /src/c_subst.c
parentIn progress (diff)
downloadunixize-ff28ca95c0744bbcd30536faa169a12b1fbe5b32.tar.gz
unixize-ff28ca95c0744bbcd30536faa169a12b1fbe5b32.tar.bz2
unixize-ff28ca95c0744bbcd30536faa169a12b1fbe5b32.tar.xz
unixize-ff28ca95c0744bbcd30536faa169a12b1fbe5b32.tar.zst
unixize-ff28ca95c0744bbcd30536faa169a12b1fbe5b32.zip
Unicode in progress
FossilOrigin-Name: 9ec5167660a62e37c261456bc1b5d371c403803fec309dd855aa4e128ab4cfef
Diffstat (limited to 'src/c_subst.c')
-rw-r--r--src/c_subst.c66
1 files changed, 62 insertions, 4 deletions
diff --git a/src/c_subst.c b/src/c_subst.c
index 116336c..cc9823c 100644
--- a/src/c_subst.c
+++ b/src/c_subst.c
@@ -209,13 +209,71 @@ c_unicode_subst(char filename[])
p = (unsigned char*)filename;
while (*p != 0x00) {
if (*p == 0xc3) {
- if (u_isucharset((unsigned char)*(p + 1), "\xa0\xb6") == TRUE) {
- printf(">>>>{%hhx}\n", *p);
- printf(">>>>{%hhx}\n", *(p + 1));
+ if (
+ u_isucharset((unsigned char)*(p + 1), C_CHARSET_A_MAJ) == TRUE ||
+ u_isucharset((unsigned char)*(p + 1), C_CHARSET_A_MIN) == TRUE
+ ) {
*p = 'a';
- memmove(p + 1, p + 2, (strlen((const char*)p + 2) + 1) * sizeof(char));
+ 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_O_MAJ) == TRUE ||
+ u_isucharset((unsigned char)*(p + 1), C_CHARSET_O_MIN) == TRUE
+ ) {
+ *p = 'o';
+ 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_AE) == TRUE) {
+ *p = 'a';
+ *(p + 1) = 'e';
+ c_unicode_subst(filename);
+ }
+ if (u_isucharset((unsigned char)*(p + 1), C_CHARSET_N) == TRUE) {
+ *p = 'n';
+ memmove(
+ p + 1,
+ p + 2,
+ (strlen((const char*)p + 2) + 1) * sizeof(char)
+ );
+ c_unicode_subst(filename);
+ }
+ if (*(p + 1) == 0x72) {
+ *p = '2';
+ memmove(
+ p + 1,
+ p + 2,
+ (strlen((const char*)p + 2) + 1) * sizeof(char)
+ );
+ c_unicode_subst(filename);
+ }
+ if (*(p + 1) == 0x73) {
+ *p = '3';
+ memmove(
+ p + 1,
+ p + 2,
+ (strlen((const char*)p + 2) + 1) * sizeof(char)
+ );
+ c_unicode_subst(filename);
+ }
+ if (*(p + 1) == 0x75) {
+ *p = 'u';
+ memmove(
+ p + 1,
+ p + 2,
+ (strlen((const char*)p + 2) + 1) * sizeof(char)
+ );
+ c_unicode_subst(filename);
+ }
}
p++;
}