cancel
Showing results for 
Search instead for 
Did you mean: 

alfresco share wrong utf-8 encoding

dga
Champ in-the-making
Champ in-the-making
Hello all,

i hava a problem  and i need your help.

I want to see in my pages characthers like șțâîă overriding the common.properties and slingshot.properties, but i don't know how.

just an example:
- original
header.logout.label=Logout
header.logout.description=Logout
- translated
header.logout.label=Ieșire
header.logout.description=Ieșire
but insted of ș i have other characters. I tried hex and asci code, but in some browser are ok, in other not.


What i tried:
I.
1. i edited slingshot.properties with proper translation, but after restart  i saw wrong charachters
2. i edited slingshot_en.properties with proper translation, but after restart  i saw wrong charachters
3. i created slingshot_ro.properties with proper translation, but after restart  i saw wrong charachters
4. just for test: i modified the header_en.properties… same result

file encoding = utf-8
web page meta = utf-8

II.
i. created my own dashlets with myown.properties file and all characthers are ok, utf-8.


So… i realy don't know what can i need to do.
Pleas give me some guides.

Thank you all,
Geo


[SOLVED]
Simple, but not so obvious for me.
i take as example french translation and i saw file encodin = us-asci and special character encoded as ECMAScript.
So my characters look like this:
ă ș ț î â = \u0103 \u0219 \u021b \xee \xe2
now it's work ok


5 REPLIES 5

iblanco
Confirmed Champ
Confirmed Champ
You are right, that's the right solution.

Java .properties files are supposed to contain ASCII only characters and all the rest must be encoded to their unicode equivalents. I think it might be more forgivin with ISO-8859-1 encoded files, but not others.

In fact I think the Alfresco build scripts preprocess all .properties files and encode all non ASCII characters for you, but obviously that only works at build time, not if you edit the .properties files later.

vassilisx
Champ in-the-making
Champ in-the-making
Is this the only way you have found to display non-latin characters? For Greek language, for example, it is impossible to just use UTF-8 codes for text. One would have to transform every single letter!

Well AFAIK your best option is to write the .properties file in whatever codec you want, probably UTF8 in order to be able to use greek characters and then encode it using native2ascii tool (included in the JRE i think).

There is a "newer" way of specifying properties files by an XML format. There you can use UTF8 or probably any other codec as long as you declare it in the XML file. But Alfresco is not using this format for internationalization so I think you can not use it in this context.

mrogers
Star Contributor
Star Contributor
http://en.wikipedia.org/wiki/.properties

Properties files are always LATIN_1.

ipirat
Champ in-the-making
Champ in-the-making
I am using the ResourceBundle Editor Eclipse Plugin for years:

http://eclipse-rbe.sourceforge.net/screenshots.htm

In Eclipse Settings, you can turn on/off parameters to automatically convert \uXXX values to readable characters for display and convert them back to \uXXX codes when writing to files