I would like to perform Unicode case-folding in the Lua interpreter of LuaTeX running within the TeX Live ecosystem.

Can you suggest whether there is an existing implementation available in TeX Live, or whether I should implement the case-folding algorithm myself using the UnicodeData.txt and CaseFolding.txt files provided as a part of the unicode-data package in TeX Live?

Side note: LaTeX3 implements case-folding as TeX commands, see function \str_casefold:n in LaTeX3 interfaces. I would find it somewhat amusing if it were easier to case-fold a string in TeX than it would be in Lua. Is it?

EDIT: I updated the question to make it clear that I am looking for a Lua implementation of Unicode case-folding, not a TeX (or LaTeX3) implementation.

  • 1
    ctan.org/pkg/lua-uni-algos Jan 23, 2023 at 15:23
  • @DavidCarlisle: In general, yes. In my use case, I need to case-fold a programmatic string in Lua. TeX will never see this string.
    – Witiko
    Jan 23, 2023 at 15:33
  • @UlrikeFischer: Thank you, this seems to be the answer to my problem. If you post it as an answer, I will accept it.
    – Witiko
    Jan 23, 2023 at 15:38

1 Answer 1


The lua-uni-algos package https://ctan.org/pkg/lua-uni-algos contains an implementation.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .