-
Bug
-
Resolution: Done
-
Major
-
2.0.0.Beta1, 1.3.24.Final, 1.4.0.Final
-
None
Shift-JIS encoding POST form-data is garbled because Undetow uses java.net.URLDecoder to decode POST data but java.net.URLDecoder does not always work correctly with Shift_JIS. A query parameter also has same issue even if setting url-charset="Shift_JIS" because Undertow's internal decode logic for query parameter has similar issue.
For example, "ใในใ"(\u30C6\u30B9\u30C8), which means "test" in Japanese:
- java.net.URLEncoder encodes to %83%65%83%58%83%67
- Browser (IE, Firefox, Chrome) encodes to %83e%83X%83g
java.net.URLDecoder can decode an encoded parameter by java.net.URLEncoder (%83%65%83%58%83%67) correctly but it's unable to decode an encoded parameter by browser (%83e%83X%83g).
In RFC-3986, it doesn't always need to encode alpha (uppercase and lowercase letters), digit, hyphen, period, underscore or tilde of multi-byte character's second or later byte-code. However, java.net.URLDecoder (and Undetow internal one) doesn't support this percent-encoding rule fully.
- relates to
-
JBEAP-5851 [GSS](7.0.z) Shift-JIS encoding data become garbled
- Verified
-
JBEAP-5852 [GSS](7.1.0) Shift-JIS encoding data become garbled
- Verified