0

I want to give Turkish character as a value in my .properties file. But outcome not shown well

I put into properties file

myvalue=BİLGEHAN

Outcome B?LGEHAN

I found some solutions in stackoverflow. But I want to clarify

I tried to add properties file encoding try both of them UTF-8 and ISO-8859-1 not working

@PropertySource(
    value = {"my.properties"},
    encoding = "UTF-8"
)

I set -Dfile.encoding=UTF-8 it is not working native2ascii conversion work

Only thing I can do I use native2ascii and convert my value to ascii format and then my message shows well

I want to clarify is there any way to use my special characters in properties file or is this only way to do convert ascii and use it?

UTF-8 encoding of application.properties attributes in Spring-Boot

M. Deinum
  • 104,041
  • 21
  • 200
  • 207
Bilgehan
  • 969
  • 1
  • 10
  • 27
  • Changing the encoding doesn't help if your file isn't saved as UTF-8. Make sure that your properties file is an actual `UTF-8` file. Also on older java (and Spring) version the properties are expected to be in ISO-8859-1 format (the default and standard for a long time). The `-Dfile.encoding=UTF-8` should kind of work but that might depend on how you are launching things. – M. Deinum Jan 05 '22 at 09:29
  • Hi I use intellij 2021 and spring 2.5 so I try in newer versions – Bilgehan Jan 05 '22 at 10:29

0 Answers0