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

IDN cannot handle "." properly

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None

      Description

      If "." is an valid IDN that comply to RFC 3490, IDN.toASCII() should be able to handle it; otherwise, IDN.toASCII() should throw IAE as the specification suggested. However, IDN.toASCII(".") throws StringIndexOutOfBoundsException, this behavior does not comply the the specification:

      String host = IDN.toASCII(".", IDN.USE_STD3_ASCII_RULES);
      Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
              at java.lang.StringBuffer.charAt(StringBuffer.java:204)
              at java.net.IDN.toASCIIInternal(IDN.java:279)
              at java.net.IDN.toASCII(IDN.java:118)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                xuelei Xue-Lei Fan
                Reporter:
                xuelei Xue-Lei Fan
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: