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

Having trouble installing Oxygen? Got a bug to report? Post it all here.
michaelmh
Posts: 14
Joined: Tue Jan 19, 2016 5:55 pm

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

Post 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
Radu
Posts: 9058
Joined: Fri Jul 09, 2004 5:18 pm

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

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
michaelmh
Posts: 14
Joined: Tue Jan 19, 2016 5:55 pm

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

Post 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
Radu
Posts: 9058
Joined: Fri Jul 09, 2004 5:18 pm

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

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
michaelmh
Posts: 14
Joined: Tue Jan 19, 2016 5:55 pm

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

Post 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
Radu
Posts: 9058
Joined: Fri Jul 09, 2004 5:18 pm

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

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply