Special characters included string can not convert to the actual characters

88 Views Asked by At

expected_string : Hello "Ôppőrtunĩty" 01

properties_file_string : Hello "Ôpp\u0151rtun\u0129ty" 01

default charset = windows-1252

Above string is getting using properties file. So when it paste to the properties file it is displaying as properties_file_string. After print that in console that string shows as

Hello "Ôpp?rtun?ty" 01

Instead of that, is there any way to get : Hello "Ôppőrtunĩty" 01

1

There are 1 best solutions below

0
On

The Windows-1252 is simply Windows character set and is a superset of ISO-8859-1.

This was developed by Microsoft and is used primarily by Microsoft Windows systems. This encoding uses the 128-159 code range to display additional characters not included in the ISO-8859-1 character set.

Since this character set is not standardized across all platforms and browsers, these character codes are not valid HTML, though they will display properly on some systems and browsers. Use of these character codes will result in inconsistent display across browser versions and operating systems. To properly display these characters requires a more advanced character set and encoding, such as UTF-8 Encoding Unicode Character Set.

For more info about ISO-8859-1 Difference between UTF-8 and ISO-8859-1