Class UnicodeUtils


  • public final class UnicodeUtils
    extends java.lang.Object
    • Field Summary

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

      Constructors 
      Modifier Constructor Description
      private UnicodeUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String canonicalCaseFold​(java.lang.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.
      • Methods inherited from class java.lang.Object

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

      • 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 Detail

      • UnicodeUtils

        private UnicodeUtils()
    • Method Detail

      • canonicalCaseFold

        public static java.lang.String canonicalCaseFold​(java.lang.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