Using: Spring mvc, tomcat, thymeleaf and instagram4j. When i want to display some info from instagram i using instagram4j and retrieve info from instagram4j objects but on pages i have only ????? but in idea console i have good info.
Example
in console:
on the page:
Any acts with encoding didnt good results
Thanks for help
Asked
Active
Viewed 77 times
0

Denis Deniben
- 93
- 2
- 10
-
Are your files in your project and your application configured to use UTF-8? – Jorge Campos Jun 26 '20 at 00:13
-
@JorgeCampos yes, all project and app configured to use UTF-8 – Denis Deniben Jun 26 '20 at 07:41
-
I see that are cyrillic letters, latin letters display good. – Denis Deniben Jun 26 '20 at 07:53
-
when i try do some like this ```new String(cyrillic.getBytes("Cp1252"), "Cp1251");``` or this ```new String(cyrillic.getBytes("Cp1251"), "UTF-8");``` in console output the same that on the page '??????' – Denis Deniben Jun 26 '20 at 08:09
1 Answers
0
This answer help solution of this problem
In mvc config ViewResolver add resolver.setCharacterEncoding("UTF-8");
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
ThymeleafViewResolver resolver = new ThymeleafViewResolver();
resolver.setTemplateEngine(templateEngine());
resolver.setCharacterEncoding("UTF-8");
registry.viewResolver(resolver);
}

Denis Deniben
- 93
- 2
- 10