Skip to content

luautf8 0.3.0

Latest

Choose a tag to compare

@starwing starwing released this 12 Nov 17:29

luautf8 0.3.0

Unicode 17.0.0 data, NFC correctness fixes for NFC_QC=Maybe characters,
and behavior alignment with Lua 5.5.

Highlights

  • Unicode 17.0.0: unidata.h is regenerated from UCD 17.0.0. NFC, case
    folding, categories, East Asian width and grapheme cluster data are updated.
  • NFC fixes: NFC_QC=Maybe characters whose canonical decomposition can
    recompose with the surrounding context (e.g. U+113C5 TULU-TIGALARI VOWEL
    SIGN AI, U+16121–U+16128 GURUNG KHEMA, U+16D68 KIRAT RAI) are no longer
    decomposed and left unrecomposed. utf8.isnfc and utf8.normalize_nfc now
    use the same scan, and normalize_nfc's second result always agrees with
    isnfc.
  • gmatch / gsub empty matches: aligned with Lua 5.5 on every supported
    Lua version. This fixes the spurious empty matches reported in #64.
  • utf8.escape: malformed escapes now raise an error instead of silently
    producing NUL bytes or accepting unclosed brackets.
  • gsub: nil/false returns from replacement functions/tables now keep
    the original text and count substitutions correctly.
  • LuaLS type definitions (lua-utf8.d.lua), UD_STATIC build option, and
    MSVC 2026 warning fixes.

Breaking changes

  • utf8.escape is stricter: code relying on the old lenient handling of a
    trailing %, %x/%u without digits, or unclosed %{...} must be updated.
  • utf8.gmatch / utf8.gsub intentionally use Lua 5.5 empty-match semantics
    on Lua 5.1–5.4 hosts too. They may differ from the host's
    string.gmatch / string.gsub in those edge cases.

Note

0.2.1 was published through LuaRocks only (no GitHub release). It added Lua
5.5 support and fixed several utf8.widthindex / utf8.char edge cases;
those changes are included in 0.3.0.

Full Changelog: 0.2.1...0.3.0