0

I have used this code to decode a URI string: java.net.URLDecoder.decode(request.getParameter("comment"), "UTF-8"). and it works. e.g.

Input: cl%C4%81mor

Output: clāmor

But when I use @MultipartConfig in my java servlet file, this happens:

Input: cl%C4%81mor

Output: cl%C4%81mor

I am not sure why this didn't work. Can you tell me why this happened and/or how to fix it? Thanks in advance.

MBJH
  • 1,571
  • 3
  • 17
  • 36

1 Answers1

0

Could it be that @MultipartConfig changes the default request encoding in your setup? Can you check what request.getCharacterEncoding() returns UTF-8? Is the value returned from request.getParameter("comment") different after you add @MultipartConfig.

It would be easier to answer if you would provide more information about your setup. If you are using Spring with JEE annotations maybe you want to look at this answer.

Karol Dowbecki
  • 43,645
  • 9
  • 78
  • 111