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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • 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

    Description

      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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: