D
D
DunkanMaklaut2020-07-24 10:50:35
Java
DunkanMaklaut, 2020-07-24 10:50:35

What is with the encoding on the servlet?

Some data is received from the JSP form to the servlet, in this case I enter the surname "Ivanov" which I write to String, in the debugger I see that string=Ðванов, the page is encoded UTF-8, changing to windows-1251 did not give anything , only the characters have changed, but the text is still illegible ... Tell me what could be the reason and how to fix it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DunkanMaklaut, 2020-07-24
@DunkanMaklaut

search=new String(search.getBytes("ISO-8859-1"),"utf-8");
All decided by this

D
Denis Zagaevsky, 2020-07-24
@zagayevskiy

https://m.habr.com/ru/post/147843/
Original utf-8, recognized as win-1252.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question