Page 1 of 1

Properties editor understands hex but does not create hex for non-ASCII characters

Posted: Wed Nov 08, 2017 1:22 pm
by michaelmh
Hi,

I was glad to see that I can edit a .properties file with OxygenXML and it decoded all hex characters (e.g. \u00FC for ü). Apparently the file name extension is linked to a Properties Editor.

How can I ensure that all non-ASCII characters will be encoded in \u notation, I am pretty sure that this should be possible.

Thanks,
- Michael

Re: Properties editor understands hex but does not create hex for non-ASCII characters

Posted: Wed Nov 08, 2017 2:26 pm
by Radu
Hi Michael,

The encoding in which the properties files are saved is "ISO-8859-1". And in this encoding you can save German characters like "ü" without escaping them.
Oxygen's support for editing properties files will indeed automatically un-escape all "\u" encoded characters before showing you the content. The save operation will percent encode only characters which cannot be encoded in the ISO-8859-1 format. As the "ü" can be saved directly encoded in the ISO-8859-1 format, the save operation will not escape it.
I tested opening a properties file containing an unescaped "ü" in it using the default Java support and there seems to be no problem loading and using it.

Regards,
Radu

Re: Properties editor understands hex but does not create hex for non-ASCII characters

Posted: Wed Nov 08, 2017 2:48 pm
by michaelmh
Radu,

Thanks for the info. I will test whether our application accepts äöü without \u encoding. Until now all such files I saw used that encoding…

- Michael

Re: Properties editor understands hex but does not create hex for non-ASCII characters

Posted: Wed Nov 08, 2017 2:55 pm
by Radu
Hi Michael,

Yes, it would be great if you could give us feedback on this. If you encounter any problem with an application not properly loading the properties files we can consider for example escaping all characters which are not in the a-z and A-Z ranges.

Regards,
Radu

Re: Properties editor understands hex but does not create hex for non-ASCII characters

Posted: Wed Mar 07, 2018 6:44 pm
by michaelmh
Radu,
you were right, it works.
Our engineers use an editor which creates the \u notation transparently for them and apparently for all non-ASCII characters. So if I from Oxygen commit something to the repository or they from their environment, we will see many differences just because of that encoding thing.

I guess we will live with that, though.
Thanks,
- Michael

Re: Properties editor understands hex but does not create hex for non-ASCII characters

Posted: Thu Mar 08, 2018 10:20 am
by Radu
Hi Michael,

I understand, the properties documents created by both Oxygen and the other editor are equivalent but indeed for German characters you will have lots of differences presented. As the ISO-8859-1 encoding necessary for the properties files allowed saving German characters without escaping them we considered it would be a better approach for readability purposes not to escape them.

Regards,
Radu