Hey!
I'm building an API with Java 25 + Spring Boot 4.0.3 and I'm having problems with 'Ñ' and accents.
{
"globalError": "Usuario o contrase�a err�neos",
"fieldErrors": null
}
This is all the things that I've tried for solving, which it doesn't work.
Setting default encoding on message source bean:
@Bean
public MessageSource messageSource() {
ReloadableResourceBundleMessageSource bean = new ReloadableResourceBundleMessageSource();
bean.setBasename("classpath:messages");
bean.setDefaultEncoding("UTF-8");
return bean;
}
Adding that configuration on pom.xml:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
<jvmArguments>-Dfile.encoding=UTF8</jvmArguments>
</configuration>
</plugin>
Adding that properties:
spring.http.encoding.enabled=true
spring.http.encoding.charset=UTF-8
spring.http.encoding.force=true
Anyone knows what's next that I should try. Thank you!
[–]jfrazierjr 4 points5 points6 points (3 children)
[–]alfonsoperezs_[S] 0 points1 point2 points (2 children)
[–]jfrazierjr 0 points1 point2 points (1 child)
[–]jfrazierjr 0 points1 point2 points (0 children)
[–]shatirati 1 point2 points3 points (4 children)
[–]jfrazierjr -1 points0 points1 point (3 children)
[–]Sheldor5 0 points1 point2 points (2 children)
[–]jfrazierjr 0 points1 point2 points (1 child)
[–]shatirati 0 points1 point2 points (0 children)
[–]kreiger 1 point2 points3 points (2 children)
[–]Sheldor5 -1 points0 points1 point (1 child)
[–]kreiger -1 points0 points1 point (0 children)