Pinned topic How to set URL encoding to UTF-8
bergmark 110000GUM942 PostsACCEPTED ANSWER
Re: How to set URL encoding to UTF-82013-10-01T14:57:10Z in response to datacrush
WebSphere Liberty profile should decode URLs as UTF-8 by default.
I assume this is a GET request, and not a POST correct?
Is it possible your problem is in how the response is encoded? How are you "displaying" the character? If you are writing it back in the response, then encoding used for the response could affect things as well.
Does the output change if you call request.setCharacterEncoding to UTF-8 before calling request.getParamter? Does the output change if you call response.setCharacterEncoding to UTF-8 before writing anything to the response writer?
datacrush 270006DJ233 PostsACCEPTED ANSWER
Re: How to set URL encoding to UTF-82013-10-01T17:11:27Z in response to bergmark
Thanks, request.setCharacterEncoding solved it.
Yes, it is a GET.
No, not displaying the character. I suspect Websphere should be running UTF-8 but "displaying" may not always be accurate. I used String.getBytes("UTF-8") and converted the byte to hex and display the hex instead. From there I could tell whether the character is correctly encoded in UTF-8.
Using this method, it seems, I do not require a jvm.options file. Which is good. Because AS/400 would throw "QEJBSVR: FAILED TO CREATE CONSOLE FILE: /QIBM/UserData/WebSphere/AppServer/V85/Base/wlp/output/servers/server1/logs/console.log" each time I restart the server without manually deleting console.log. That is only when jvm.options file is in use to declare -Dfile.encoding=UTF-8.
Separately, I also found out that specifying -Dclient.encoding.override=UTF-8 in the jvm.options file works. But I like your solution setCharacterEncoding solution better.