[SOLVED] Correct encoding for language files

I’m trying to (as yet unsuccessfully) translate the astro binding to turkish. I am using the Paper UI to configure my system.

I have created a file astro_tr.properties, saved it next to the already existing astro_de.properties. The file gets correctly picked up and used for translation. All well until this step :slight_smile:

What I could not get to work is using proper turkish characters. I tried using

discovery.astro.sun.local.label = Yerel güneş bilgileri

and saved the file as UTF-8. This results in broken display of characters, as if each byte is rendered for itself.

Then, I tried using

discovery.astro.sun.local.label = Yerel güne\015f bilgileri

and saving the file as ISO-8859 as all the other translations files in the smarthome source tree. 015f is the UTF-8 codepoint for the desired sign. Still no success, I see just the backslash and the 015f shown in the label.

Interestingly, the very same character is displayed correctly in the /start/index page . This page seems to explictly set its encoding to text/html;charset=utf-8, whereas the paperui only uses text/html

Any hints?

Can you give this one a try in the ISO encoded file?

discovery.astro.sun.local.label = Yerel güne\u015F bilgisi

That one little “u” after the backlash solved my problems :blush:

I guess it was too late in the day to properly read up on how unicode characters are written. Either that or being too lazy to fire up Eclipse and using Emacs to write the file instead.

A pull request for the first turkish translated binding (astro) is on its way, hopefully in time for 2.4.0

Great. Nice to hear.

Aaaand here we go… The first binding to be translated to turkish :smile:

1 Like