Uploaded image for project: 'Nutch'
  1. Nutch
  2. NUTCH-1685

URLUtil.toUNICODE fails on IDNs

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.7, 2.2.1
    • Fix Version/s: 2.3, 1.8
    • Component/s: None
    • Labels:
      None
    • Environment:

      Java 7, OpenJDK 64-Bit, 1.7.0_25

      Description

      URLUtil.toUNICODE() fails on IDNs and returns null instead of the Unicode URL. The constructor of URI obviously does not accept IDN host names. For http://www.xn--evir-zoa.com/ the constructor IDN() throws the exception:

      java.net.URISyntaxException: Illegal character in hostname at index 11: http://www.├ževir.com/
      

      Principally, IDN.toUnicode() can convert URLs (not only domain or host names). However, it does not convert URLs with host part consisting of only two parts: http://xn--uni-tbingen-xhb.de/. Is that the reason why we need URLUtil.toUNICODE() ?

        Attachments

        1. NUTCH-1685-2x-test.patch
          1 kB
          Sebastian Nagel

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                snagel Sebastian Nagel
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: