Spring web application encoding

I am currently working on a web application platform called by other sites using POST forms. Some sites call us UTF-8, others call us using ISO-8895-1. Since my application is in UTF-8, some characters sent by calling sites seem weird on my side.

Example: Montreal → Montreal

I tried to "convert" the string as follows:

new String(request.getParameter("city").getBytes("ISO-8895-1"), "UTF-8");

But I do not work, I get "Montr? Al"

Is it possible to convert the encoding as follows?

Can I use a different request encoding depending on the calling site?

+4
source share
1 answer

, . ISO-8895-1 ISO-8859-1 (8895 -> 8859).

+1

Source: https://habr.com/ru/post/1525104/


All Articles