On 09.11.2021 21:57, Rahkonen Jukka (MML) wrote:
Hi Ede,

I start to think that I am on a safe side with the Finnish language files.  All the 
special characters in the file are Unicode escaped like the translation "Päätä 
piirtäminen" in string
com.vividsolutions.jump.workbench.ui.cursortool.MultiClickTool.finish-drawing=P\u00e4\u00e4t\u00e4
 piirt\u00e4minen

If I understand right all the characters in the file are the just the same as 
ISO-8859-1 and UTF-8. And .properties files seem to be plain text files without 
any character set headers or magic strings so change into UTF-8 would not 
really change anything.

right. as long as all non-ascii characters are escaped _and>_ you edit the 
files as UTF-8 _and_ only add ascii-characters again (escaping!) it should be fine.

It seems like the Finnish translation could be OK even without Unicode escapes because all 
the few special characters we have (åäöÅÄÖ) belong  to the ISO-8859-1 set 
https://www.w3schools.com/charsets/ref_html_8859.asp like "small a, umlaut mark" 
https://www.w3schools.com/charsets/tryit.asp?deci=228&ent=auml. But in that case change 
from 8859-1 into UTF-8 would break the translations.

yes, UTF-8 editing will garble those

I was reading that Java 9 supports UTF-8 properties so I made some tests with 
Unicode escapes, native 8859-1 characters, and UTF-8 characters.

Unicode escapes:
OK with Java 8
OK with Java 11

Native 8859-1:
OK with Java 8
Garbled with Java 11

UTF-8:
Garbled with Java 8
OK with Java 11

Thus I think that as long as we support Java 8 the properties files should use 
Unicode escapes everywhere.

not really.

i plan to convert the whole repo to UTF-8 (java,properties, every text really) 
and add a custom ResourceBundle.Control to I18N as described in 
https://stackoverflow.com/a/4660195/1308810, that'll make sure that the 
language files are loaded as UTF-8, even in java8.

..ede


_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to