Class TextNormalizationHelper

java.lang.Object
com.perforce.p4java.impl.mapbased.rpc.sys.helper.TextNormalizationHelper

public class TextNormalizationHelper extends Object
This helper class dynamically loads the "java.text.Normalizer" in JDK 6 or above using reflection. It provides the method normalize which transforms Unicode text into an equivalent composed or decomposed form. The normalize method supports the standard normalization forms described in Unicode Standard Annex #15 — Unicode Normalization Forms.
  • Field Details

  • Constructor Details

    • TextNormalizationHelper

      public TextNormalizationHelper()
  • Method Details

    • isNormalizationCapable

      public static boolean isNormalizationCapable()
      Checks if is normalization capable.
      Returns:
      true, if is normalization capable
    • isNormalized

      public static boolean isNormalized(String text)
      Tests whether the text is normalized.
      Parameters:
      text - the text to be checked for normalization
      Returns:
      true if the text is normalized; false otherwise.
    • normalize

      public static String normalize(String text)
      Normalizes the text.
      Parameters:
      text - the text to be normalized
      Returns:
      string the normalized text