-1

Have an URL with non-latin symbols in query params:http://localhost:9080/proxy-octopus/oct2c/!adm_v2_Common.DialogForm?func=FiltrProc&title=Поиск процедур по набору атрибутов

Changed url encoding for WAS to Windows-1251: client.encoding.override set to Windows-1251

Query parameters are got good. Next code returns valid value: "Поиск процедур по набору атрибутов".

request.getParameter("title") 

But for next code I've got valid value: "func=FiltrProc&title=Ïîèñê%20ïðîöåäóð%20ïî%20íàáîðó%20àòðèáóòîâ".

request.getQueryString()

Also I can receive real value ("func=FiltrProc&title=Поиск%20процедур%20по%20набору%20атрибутов") by next way:

new String(request.getQueryString().getBytes(Charsets.ISO_8859_1),"Windows-1251")

What I must do to receive valid value on request.getQueryString()?

Gregory
  • 413
  • 5
  • 16

1 Answers1

0

For internationalization it is more reliable to use UTF-8 encoding.

So, try to change client.encoding.override to UTF-8.

Also, check if your title parameter is properly url-encoded.

  • Can't change to UTF-8 because I've got legacy application with Windows-1251 encoding. If tittle is not properly encoded, I wouldn't be able to get properties by request.getParameter("title") method, would me? – Gregory Jul 31 '15 at 07:39
  • You mean source code in 1251? Can you convert all the source code to UTF-8 and use the UTF-8 on the WAS? Seams request.getQueryString() uses default encoding. – Alexander Chernykh Jul 31 '15 at 11:14
  • It's **legacy** project so I can't change it's encoding. – Gregory Jul 31 '15 at 11:45
  • Seams like. But I've overrided "client.encoding.override" so all must be OK. That all my question: What I am wrong. – Gregory Jul 31 '15 at 11:46