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

multipart/form-data plugin doesn't support UTF-8 encoded forms

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • None
    • 1.2.GA
    • None
    • None

    Description

      Forms with utf-8 encoding are not supported.
      There are two problems:
      1. apache-mime4j-0.6 does not detect the encoding properly, the mime body parts are created with us_ascii content type.
      2. the Stream Decoder used in apache-mime4j-0.6 (com.sun.nio...) is broken and does not decode correctly the InputStream even if you force the content type to "UTF-8" and use the proper
      nio stream decoder.

      Workaround:
      1. I hacked the MultipartInputImpl$ReaderBackedInputStream class to extract the InputStream from the Reader and made the Read method to ready directly from the InputStream instead from the broken Reader.
      2. In my webservice I used "input.getFormDataPart(name, byte[].class, byte[].class);" to get the bytes directly from the input stream and then encoded the in UTF-8 to get the corrected decoded String.

      Attachments

        Activity

          People

            patriot1burke@gmail.com Bill Burke (Inactive)
            giladgaron Gilad Garon (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: