There is an application on Tomcat to do internationalization. I use JSTL fmt tags, data is stored in properties files. The English text is displayed correctly, but the Cyrillic script displays approximately the same characters as JINDER in JSP:

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <c:set var="language" value="${not empty param.language ? param.language : not empty language ? language : pageContext.request.locale}" scope="session" /> <fmt:setLocale value="${language}" /> <fmt:setBundle basename="controller.internationalization.i18n.lang" var="lang" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 

The question is how to make the correct text display.

Update : I decided through native2ascii to change to ISO-8859-1 encoding, the file began to look like signing=\u00d0\u0092\u00d1\u0085\u00d0\u00be\u00d0\u00b4 result did not change, the Cyrillic alphabet is displayed crookedly

  • the question is settled, I changed the encoding on UTF-8 with the help of native2ascii and everything fell into place - Myroslav Prutkov

1 answer 1

Native encoding is only ISO-8859-1, if there is spring, then put its transcoder in web.xml

 <filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>