Cyrillic in the database after sending a request from the application?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
36 views
Hello.

There is a form to record the machine name and her year.
5bc9a2add90a6411534742.png

When it is submitted to the database goes as Cyrillic.
If you create a query from the database itself then everything works fine (the photo shows a normal result).
5bc9a2d1146c4825840626.png

Looking for a solution, basically saying change the encoding in the database, but there I always UTF-8 (utf8-general-ci in the database itself).

Another forum one was seen to change the url in hibernate.cfg.xml but said development environment so that it is impossible as written.
5bc9a41e66e4c358205075.pngThe link to the project.

Grateful for the help!
by | 36 views

2 Answers

0 like 0 dislike
Found the answer, problem with encoding in Tomcat service.
Tomkat uses default encoding ISO-8859-1.
Accordingly, convert from her need you all.

example:
new String(req.getParameter("name").getBytes("ISO-8859-1"), Charset.forName("UTF-8"));


Thank you all for the help!
by
0 like 0 dislike
in conjunction "encoding inputs encoding of script - coding database connection encoding data in a table" somewhere crept in not UTF. It is necessary to check each step
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
3 answers
asked Apr 14, 2019 by TonyJa
0 like 0 dislike
2 answers
asked Jun 6, 2019 by Jackson750
110,608 questions
257,186 answers
0 comments
35,390 users