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

java.net.URLDecode does not handle double byte characters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.1
    • core-libs
    • generic
    • generic



      Name: skT88420 Date: 05/19/99


      A URL is encoded using java.net.URLEncode which encodes the URL
      using the client OS's character encoding. One the server side,
      the java.net.URLDecode parses the URL and makes a unicode
      character out of each byte. If the client is using a Japanese OS
      with the SJIS encoding and types in the Japanese word setsume,
      the java.net.URLEncode converts URL word setsume to %90%D8%96%BE.
      On the server java.net.URLDecode parses the URL and makes a
      four unicode character string out of the four bytes (not a two
      character string).

      There are two problems.
      1) The URL is being encoded using the OS's default encoding but
      that encoding is not being sent to the server So, the server side
      does not know how to decode the string properly.

      2) The java.net.URLDecode class is decoding the string
      as if every byte is a character. It is not handling double or
      triple byte encoding (it must take into consideration the encoding
      of the URL
      (Review ID: 83263)
      ======================================================================

            mupadhyasunw Mayank Upadhyay (Inactive)
            skonchad Sandeep Konchady
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: