I'm doing small Spring Mvc project in InteIj idea. Mostly I'm using English so everything works fine. But when I try to use utf-8 (ru) characters on my website, I only get ???? symbols instead of text.
My html pages in IDE encoded to utf-8. Project encoding also set to utf-8. If I use logging or System.out.println ide prints in console utf-8 symbols. But when I send them in a model or just use plain text in html in utf-8 everything becomes ???
Html encoding also set to
I've tried to set filter which will encode all requests and responses to utf-8. Still same ???? symbols.
my html:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
<meta charset="UTF-8"/>
<div th:replace="fragments/header :: header-css"></div>
</head>
<body>
<div th:replace="fragments/header :: header"/>
<div class="container">
<header>
<h1 align="center" th:text="${text}">
ру текст (utf-8 ru text)
</h1>
</header>
</div>
</body>
</html>
my controller:
@GetMapping
public ModelAndView showCheckList() {
String text = "тестовый текст";
ModelAndView modelAndView = new ModelAndView();
modelAndView.addObject("text",text);
modelAndView.setViewName("shop/CheckList");
return modelAndView;
}