diff options
author | Takuji Tanaka <ttk@t-lab.opal.ne.jp> | 2021-09-05 05:27:47 +0000 |
---|---|---|
committer | Takuji Tanaka <ttk@t-lab.opal.ne.jp> | 2021-09-05 05:27:47 +0000 |
commit | 27e58ac812071b437d4995f47dbb17f927cbbf09 (patch) | |
tree | 995861cbcbe5d7dc9bfe4a9e3368f068714c005a | |
parent | 614f9cb33043442fbbbb74604080e6703843338f (diff) |
upmendex: support I-Y ordering in Lithuanian
git-svn-id: svn://tug.org/texlive/trunk@60426 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/upmendex/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/upmendex/fwrite.c | 19 |
2 files changed, 23 insertions, 1 deletions
diff --git a/Build/source/texk/upmendex/ChangeLog b/Build/source/texk/upmendex/ChangeLog index 6b5a8432ec1..5745343f5ff 100644 --- a/Build/source/texk/upmendex/ChangeLog +++ b/Build/source/texk/upmendex/ChangeLog @@ -1,3 +1,8 @@ +2021-09-05 TANAKA Takuji <ttk@t-lab.opal.ne.jp> + + * fwrite.c: + Support I-Y ordering in Lithuanian. + 2021-09-04 TANAKA Takuji <ttk@t-lab.opal.ne.jp> * version 0.59 Beta version. diff --git a/Build/source/texk/upmendex/fwrite.c b/Build/source/texk/upmendex/fwrite.c index ff29536df7b..e8ecbd48849 100644 --- a/Build/source/texk/upmendex/fwrite.c +++ b/Build/source/texk/upmendex/fwrite.c @@ -740,7 +740,8 @@ static void index_normalize(UChar *istr, UChar *ini, int *chset) UChar32 c32; UErrorCode perr; UCollationResult order; - static int hanzi_mode=0; + UCollationStrength strgth; + static int hanzi_mode=0, i_y_mode=0; ch=istr[0]; *chset=charset(istr); @@ -883,6 +884,22 @@ static void index_normalize(UChar *istr, UChar *ini, int *chset) return; } } + if (ch==0x059||ch==0x079) { + /* check Y versus I for Lithuanian */ + if (i_y_mode==0) { + strgth = ucol_getStrength(icu_collator); + ucol_setStrength(icu_collator, UCOL_PRIMARY); + strX[0] = 0x059; strX[1] = 0x00; /* Y */ + strZ[0] = 0x049; strX[1] = 0x00; /* I */ + order = ucol_strcoll(icu_collator, strZ, -1, strX, -1); + if (order==UCOL_EQUAL) i_y_mode=2; else i_y_mode=1; + ucol_setStrength(icu_collator, strgth); + } + if (i_y_mode==2) { + ini[0] = 0x049; /* I */ + return; + } + } if (ch==0x0C6||ch==0x0E6||ch==0x152||ch==0x153||ch==0x132||ch==0x133 ||ch==0x0DF||ch==0x1E9E||ch==0x13F||ch==0x140||ch==0x490||ch==0x491) { strX[0] = u_toupper(ch); strX[1] = 0x00; /* ex. "Æ" "Œ" */ |