re PR libgcj/21606 (java.net.URI fails to decode lowercase hex codes)
authorTom Tromey <tromey@redhat.com>
Mon, 16 May 2005 20:27:48 +0000 (20:27 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Mon, 16 May 2005 20:27:48 +0000 (20:27 +0000)
PR libgcj/21606:
* java/net/URI.java (unquote): Handle lower-case letters as well.

From-SVN: r99792

libjava/ChangeLog
libjava/java/net/URI.java

index 1b35743c61ee643a01eb20e0a978812de7bb9781..94cdae92fef8f086c02cc5ab9b806bdd314db37d 100644 (file)
@@ -1,3 +1,8 @@
+2005-05-16  Tom Tromey  <tromey@redhat.com>
+
+       PR libgcj/21606:
+       * java/net/URI.java (unquote): Handle lower-case letters as well.
+
 2005-05-16  Ziga Mahkovec  <ziga.mahkovec@klika.si>
 
        PR libgcj/20504
index 95577fca456c3495613628c480d4a4e804516d0f..c466b7198169b8826bf6f6c56e796a39f8e3e4d7 100644 (file)
@@ -313,9 +313,8 @@ public final class URI
          {
            if (i + 2 >= str.length())
              throw new URISyntaxException(str, "Invalid quoted character");
-           String hex = "0123456789ABCDEF";
-           int hi = hex.indexOf(str.charAt(++i));
-           int lo = hex.indexOf(str.charAt(++i));
+           int hi = Character.digit(str.charAt(++i), 16);
+           int lo = Character.digit(str.charAt(++i), 16);
            if (lo < 0 || hi < 0)
              throw new URISyntaxException(str, "Invalid quoted character");
            buf[pos++] = (byte) (hi * 16 + lo);