java.lang.Object
org.minidns.idna.MiniDnsIdna

public class MiniDnsIdnaextends Object
Utility class for Internationalized Domain Names in Applications (IDNA) processing.
Provides methods to convert between Unicode and ASCII representations of domain names according to IDNA specifications.
  • Field Details

    • idnaTransformator

      private static IdnaTransformator idnaTransformator
      The active IDNA transformator implementation
  • Constructor Details

    • MiniDnsIdna

      public MiniDnsIdna()
      The transformator is a single static instance shared by every caller, so an object here carries no per-instance state.
  • Method Details

    • toASCII

      public static String toASCII(String string)
      Converts a Unicode string to its ASCII representation using IDNA.
      Parameters:
      string - the Unicode string to convert
      Returns:
      the ASCII representation
    • toUnicode

      public static String toUnicode(String string)
      Converts an ASCII string back to its Unicode representation using IDNA.
      Parameters:
      string - the ASCII string to convert
      Returns:
      the Unicode representation
    • setActiveTransformator

      public static void setActiveTransformator(IdnaTransformator idnaTransformator)
      Sets the active IDNA transformator implementation.
      Parameters:
      idnaTransformator - the transformator to use, must not be null
      Throws:
      IllegalArgumentException - if idnaTransformator is null