Java · Case Folding and Normalization

Case Folding and Normalization

6.0.0-rc.1 · 91a27bdd

Case folding fills a gap: the JDK ships no Unicode case folding.

byte[] folded = StringZilla.caseFold("Straße".getBytes(UTF_8));         // → "strasse" (ß folds to ss)
StringZilla.Match match = StringZilla.uncasedIndexOf(haystack, needle); // caseless search

byte[] composed = StringZilla.normalize("é".getBytes(UTF_8), StringZilla.NormalForm.NFC);   // "e" + U+0301 → "é"
byte[] ascii = StringZilla.normalize("fi".getBytes(UTF_8), StringZilla.NormalForm.NFKC);     // ligature "fi" → "fi"
byte[] key = StringZilla.normalize("Straße".getBytes(UTF_8), StringZilla.NormalForm.NFKC_CASEFOLD); // → "strasse"