summaryrefslogtreecommitdiff
path: root/indexing/xindex/lualatex/xindex-base.lua
diff options
context:
space:
mode:
Diffstat (limited to 'indexing/xindex/lualatex/xindex-base.lua')
-rw-r--r--indexing/xindex/lualatex/xindex-base.lua23
1 files changed, 18 insertions, 5 deletions
diff --git a/indexing/xindex/lualatex/xindex-base.lua b/indexing/xindex/lualatex/xindex-base.lua
index ff44943724..77fc6894c9 100644
--- a/indexing/xindex/lualatex/xindex-base.lua
+++ b/indexing/xindex/lualatex/xindex-base.lua
@@ -8,7 +8,7 @@
-- $Id: xindex-base.lua 22 2022-02-07 12:18:15Z hvoss $
-----------------------------------------------------------------------
-local info = { version = 0.55 }
+local info = { version = 0.60 }
-- check config
if pageNoPrefixDel ~= "" then
@@ -112,8 +112,14 @@ writeLog(2, "GenerateSortKeys end\n", 0)
k = 0
writeLog(2, "Sort begin\n", 0)
-table.sort(Index,UTFCompare)
+
+if use_UCA then
+ table.sort(Index, UCACompare)
+else
+ table.sort(Index,UTFCompare)
+end
writeLog(2, "Sort end\n", 0)
+
if SORTposthook then
writeLog(2, "PostHook begin\n", 0)
Index = SORTposthook(Index)
@@ -168,15 +174,19 @@ if use_UCA then
v = NewIndex[i]
-- the collator:get_lowest_char will return character on the given
-- position. It will be lowercase and without accents.
- local codepoints = collator_obj:string_to_codepoints(NormalizedUpper(v.SortKey))
+ if v.SortKey ~= nil then
+ codepoints = collator_obj:string_to_codepoints(utf8_upper(v.SortKey))
+ else
+ codepoints = collator_obj:string_to_codepoints(utf8_upper(v.sortChar))
+ end
v.sortChar = getSortChar(codepoints) --or getSortChar(collator_obj:string_to_codepoints(NormalizedUpper(v.Entry)))
if not v.sortChar then
-- alternativelly use v.Entry if SortKey doesn't contain usable string
- codepoints = collator_obj:string_to_codepoints(NormalizedUpper(v.Entry))
+ codepoints = collator_obj:string_to_codepoints(utf8_upper(v.Entry))
v.sortChar = getSortChar(codepoints)
end
+-- print("v.sortchar="..v.sortChar)
end
- writeLog(2,"done\n",0)
else
for i=1, #NewIndex do
if NewIndex[i]["SortKey"] ~= nil then
@@ -187,6 +197,9 @@ else
end
end
+
+writeLog(2,"done\n",0)
+
if SORTendhook then
NewIndex = SORTendhook(NewIndex)
end