Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8081570

IDN.toASCII failing on leading dots

    XMLWordPrintable

    Details

      Description

      IDN.toASCII method is failing on processing input parameter with leading dots
      - IllegalArgumentException: "Empty label is not a legal name".

      See test example:

      import java.net.IDN;

      public class IDNTest {

        public static void main(String[] args) {

          String okString = ".";
          String failString = ".abc";

          try {
            System.out.println(IDN.toASCII(okString)); // OK
            System.out.println(IDN.toASCII(failString)); // Exception
          } catch (Exception e) {
            e.printStackTrace();
          }
        }

      }

      Same code was working fine in JDK7.

        Attachments

          Activity

            People

            Assignee:
            robm Robert Mckenna
            Reporter:
            shadowbug Shadow Bug
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: