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.