glassfish
  1. glassfish
  2. GLASSFISH-18516

Incorrect encoding for request parameters in multipart/formdata

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 3.1.2
    • Fix Version/s: 4.0_b30
    • Component/s: web_container
    • Labels:
      None

      Description

      Request parameters with UTF-8 characters sent as part of multipart/formdata request are incorrectly decoded into ISO-8859-1 character set.
      So not Latin characters becomes '???'.

        Activity

        Hide
        akolos added a comment -

        As I see in Multipart.java file parameters get encoded into iso-8859-1 no matter what <parameter-encoding default-charset="UTF-8"/> declared in glassfish-web.xml.
        This problem only in multipart/form so I think the followinf code snippet from Multipart.java needs to be changed:

        parameters.addParameter(partItem.getName(), partItem.getString());
        

        because partItem.getString() take encoding via multipart content type, but should take encoding from Parameters.encoding or coyoteRequest.charEncoding.

        Show
        akolos added a comment - As I see in Multipart.java file parameters get encoded into iso-8859-1 no matter what <parameter-encoding default-charset="UTF-8"/> declared in glassfish-web.xml. This problem only in multipart/form so I think the followinf code snippet from Multipart.java needs to be changed: parameters.addParameter(partItem.getName(), partItem.getString()); because partItem.getString() take encoding via multipart content type, but should take encoding from Parameters.encoding or coyoteRequest.charEncoding .
        Hide
        akolos added a comment -

        Seems this issue appears after GLASSFISH-16740

        Show
        akolos added a comment - Seems this issue appears after GLASSFISH-16740
        Hide
        kchung added a comment -

        Fixed on the trunk. Should be in the next promoted build, 4.0 b30.

        Show
        kchung added a comment - Fixed on the trunk. Should be in the next promoted build, 4.0 b30.

          People

          • Assignee:
            kchung
            Reporter:
            akolos
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: