Class UnicodeUtils

java.lang.Object
org.w3c.epubcheck.util.text.UnicodeUtils

public final class UnicodeUtils extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final com.ibm.icu.text.CaseMap.Fold
     
    private static final com.ibm.icu.text.Normalizer2
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    Applies Unicode Canonical Case Fold Normalization as defined in https://www.w3.org/TR/charmod-norm/#CanonicalFoldNormalizationStep This applies, in sequence: - canonical decomposition (NFD) - case folding Note that the result is **not** recomposed (NFC), i.e.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • NFD_NORMALIZER

      private static final com.ibm.icu.text.Normalizer2 NFD_NORMALIZER
    • CASE_FOLDER

      private static final com.ibm.icu.text.CaseMap.Fold CASE_FOLDER
  • Constructor Details

    • UnicodeUtils

      private UnicodeUtils()
  • Method Details

    • canonicalCaseFold

      public static String canonicalCaseFold(String string)
      Applies Unicode Canonical Case Fold Normalization as defined in https://www.w3.org/TR/charmod-norm/#CanonicalFoldNormalizationStep This applies, in sequence: - canonical decomposition (NFD) - case folding Note that the result is **not** recomposed (NFC), i.e. the optional post-folding NFC normalization is not applied. In other words, the result is suitable for string comparison for case-insensitive string comparison, but not for display.
      Parameters:
      string - the string to normalize
      Returns:
      the string normalized by applying NFD then case folding