Reputation: 103
I use @ConfigurationProperties
to customize my own properties in application.properties.
But when I use chinese in application.properties, I found out Spring Boot load application.properties file in ISO-8859-1 encode. How do I customize this defalut encoding using UTF-8.
Upvotes: 1
Views: 2444
Reputation: 11
Try to move your definition into src/main/resources/messages_zh_CN.properties. (messages_zh_CN.properties is utf8)
Upvotes: 0
Reputation: 1952
JAVA hold all string in memory with unicode instead of its own encoding. So the importance is to tell java how to load string in correct encoding. Most common solution (i18n use this way) is to translate chinese into unicode, which java can handle it directly.
Here is an online tool to translate chinese to unicode. Hope this helps.
Upvotes: 1