Just a suggestion, without having tested it...

The Java implementation of Property is not able to read UTF-8 encoded 
characters in the .properties file because it uses Latin1 as its (only) 
encoding. See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html 
and its recommendation to use the native2ascii utility to convert the UTF8 
characters.

BTW In Java 5, they implemented property files using XML, which use UTF8 as 
their default encoding. Maybe an xml property file would work for you (don't 
forget the encoding in the header :) )

Perhaps you could try running native2ascii on your properties, or convert them 
to xml?

HTH,

Nick.


Nick James 
Systems Architect 
Direct Line: +1 763 212 0579 
  

-----Original Message-----
From: Alexey Hanin [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 25, 2007 8:46 AM
To: users@tapestry.apache.org
Subject: T5: Scrambled unicode localized message

Hi!

I am using Tapestry 5.0.4 and trying to display cyrillic unicode characters
within a simple template (Login.html):

<t:form t:id="form"
 xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
 <t:label t:for="username"/>:
 <t:textField t:id="username" t:value="prop:username"/>
 <t:submit t:value="message:submit-label"/>
</t:form>

Here are contents of my Login_ru.properties:

username-label=Юзернэйм
submit-label=Сабмит

In result i have scrambled cyrillic text:

<label for="username" id="username:label">Ð(r)зернэйм</label>:
<input id="username" name="username" type="text" value=""><img
alt="[Error]" class="t-error-icon t-invisible" id="username:icon"
src="/app/assets/tapestry/field-error-marker.png">
<input id="submit" name="submit" type="submit"
value="Сабмит"><img alt="[Error]" class="t-error-icon
t-invisible" id="submit:icon"
src="/app/assets/tapestry/field-error-marker.png"></form>


I've injected 'Messages' in Login component class and tried to resolve
localized value from ther but result was the same.
My properties file is in UTF-8, Also I have performed steps from the "How to
use UTF-8 encoding in T5" (http://wiki.apache.org/tapestry/Utf8EncodingInT5
).
Browser determines encoding correctly.
I've set encoding to UTF-8 in every place and still no success.

Please, tell me am I am missing something?

Regards,

Alexey.

Reply via email to