1

Following is my property inside the spring boot application.properties file

agent.managementId=こんにちは

When I am trying to read like

@Value("${agent.managementId}")
String tempVal;

Then I am getting the garbage value like "ã“ã‚“ã«ã¡ã¯"

how can I read that value as is?

the value inside the application.properties file

agent.managementId=こんにちは

Note :- if I change the text in ASCII then it is working but I don't want to convert it into ASCII.

Ricky Sixx
  • 581
  • 1
  • 10
  • 25
Ganesh Gudghe
  • 1,327
  • 1
  • 17
  • 41

1 Answers1

0

I resolved it by renaming application.property because as per

Spring Boot default properties encoding change?

Apparently, properties loaded by Spring Boot's ConfigFileApplicationListener are encoded in ISO 8859-1 character encoding, which is by design and according to format specification.

added

@PropertySource(value = "file:app.properties", encoding = "UTF-8")

and its working fine

Ganesh Gudghe
  • 1,327
  • 1
  • 17
  • 41