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

Better handling of UTF-8 encoding in multipart/form-data

    XMLWordPrintable

Details

    Description

      My client is uploading a file as a multipart/form-data object, where the file being uploaded has a MIME type specified (in my case, text/csv) but no charset. RESTEasy appears to be defaulting to us-ascii, causing the UTF-8 characters to be garbled. Since in many cases, one doesn't have control over the client's creation of the parts of the form, so there is no way to specify that the file being uploaded should have the charset UTF-8. It would be great if there could be a way to tell JBoss to interpret the file as UTF-8 by default.

      There currently is an option to set a default content type using an interceptor and the DEFAULT_CONTENT_TYPE_PROPERTY as described in RESTEASY-305, however that is for a case where the client isn't supplying a content type at all. In my case, the client supplies a content type but provides no mechanism to set the charset - I'd like to tell JBoss to interpret the charset as UTF-8 if no content type charset is provided.

      Attachments

        Activity

          People

            rsigal@redhat.com Ronald Sigal
            ezs_jira Elli Schwarz (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: