Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-500

Decoding of path parameters does not work correctly for some non-english characters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 2.0.1.GA
    • None
    • Hide

      Requested URL:
      http://localhost:8888/search/éa

      //Encoded into :
      http://localhost:8888/search/%C3%A9a

      http://www.w3schools.com/TAGS/ref_urlencode.asp
      (see title : URL Encoding Functions )

      Decoded in RestEasy into ;
      /search/éa

      Encode.decodePath(String path) use a

      Pattern encodedChars = Pattern.compile("%([a-fA-F0-9][a-fA-F0-9])");

      which is not always correct, some chars content 2 %'s which causes the problem.

      Show
      Requested URL: http://localhost:8888/search/ éa //Encoded into : http://localhost:8888/search/%C3%A9a http://www.w3schools.com/TAGS/ref_urlencode.asp (see title : URL Encoding Functions ) Decoded in RestEasy into ; /search/éa Encode.decodePath(String path) use a Pattern encodedChars = Pattern.compile("%( [a-fA-F0-9] [a-fA-F0-9] )"); which is not always correct, some chars content 2 %'s which causes the problem.
    • Interactive Demo/Tutorial, Compatibility/Configuration

      Requested URL:
      http://localhost:8888/search/éa

      //Encoded into :
      http://localhost:8888/search/%C3%A9a

      http://www.w3schools.com/TAGS/ref_urlencode.asp
      (see title : URL Encoding Functions )

      Although the "URL Encoding Reference" shows each char is mapped to some value in the form of '%xx'
      and é is shown to be %E9 whereas the encoding function input field converts é to %C3%A9

      Same thing happens in java as well
      (org.apache.commons.httpclient.util.URIUtil) using this one from commons-httpclient-3.1

      Decoded in RestEasy into ;
      /search/éa

      Encode.decodePath(String path) use a

      Pattern encodedChars = Pattern.compile("%([a-fA-F0-9][a-fA-F0-9])");

      which is not always correct, some chars contain 2 %'s which causes the problem like in this case

              patriot1burke@gmail.com Bill Burke (Inactive)
              fmucar fatih ucar (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: