Your java virtual machine is probably not using UTF-8 as the default charset. This is a common problem that isn't anywhere in any documentation (at Tapestry, Sun, or just about anywhere else). You can only change the default charset of your JVM before it runs. At run time, your only choice is to explicitly set the charset for each input and output reader/writer, which you can't do to the Tapestry code. To fix it, you must set the system property file.encoding to UTF-8. For tomcat users, you can do that by defining a variable called JAVA_OPTS in your shell and setting the value to "-Dfile.encoding=UTF-8"
You can determine the default charset that is set up by your OS with the following code: import java.nio.charset.Charset; public class charset { public static void main(String[] args) { System.out.println(Charset.defaultCharset().displayName()); } } On 5/6/06, Numa Schmeder <[EMAIL PROTECTED]> wrote:
Hello, Thanks for your help, here is my problem: I have a problem localizing a tapestry application in japanese, a translator has translated all properties file in japanese in utf-8, so all the properties file are encoded in utf-8, opening thoses file in eclipse or in a text editor that support utf-8 works great i can see all japanese characters correctly. Then i set as specified in the docs the property ' <property name="org.apache.tapestry.template-encoding_ja" value="UTF-8"/> ' in my .application. When i display a page in japanese i get cabalistic characters on my web page like: 'Æ—…Ã(r)¨Â à ‚¹ÃƑ'ÃƑ¼ÃƑˆ' , but characters coming from the postgres database display fines, the database is encoded in utf-8. The output of my web pages for the tapestry application is in UTF-8 which is specified by default. I have tried to set the property ' <property name="org.apache.tapestry.messages-encoding" value="UTF-8"/>' in my component or page specification but this still doesn't work i get the same cabalistic characters. I don't know if i have to do the same as for ResourcesBundle properties file and convert them using native2ascii or do i have to specify another encoding and encode my file in another character set? I use tapestry 3 and here is snapshot of my .application: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE application PUBLIC "-//Apache Software Foundation//Tapestry Specification 3.0//EN" "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd"> <!-- generated by Spindle, http://spindle.sourceforge.net --> <application name="Ec-voyage" engine- class="com.ec.web.voyage.tapestry.ECVoyageEngine"> <description>Le-Voyage website</description> <property name="org.apache.tapestry.template-encoding_ja" value="UTF-8"/> <property name="org.apache.tapestry.messages-encoding_ja" value="UTF-8"/> <property name="org.apache.tapestry.visit-class" value="com.ec.web.voyage.tapestry.Visit"/> <page name="Home" specification-path="Home.page"/> <library id="contrib" specification-path="/org/apache/tapestry/ contrib/Contrib.library"/> <library id="ec" specification-path="/com/ec/web/common/tapestry/ components/EcComponents.library"/> <library id="base" specification-path="/org/mb/tapestry/base/ base.library"/> <library id="checkboxes" specification-path="/org/mb/tapestry/ checkboxes/checkboxes.library"/> <library id="ws" specification-path="/myws/tapestry/components/ MyWorkspace.library"/> </application> If any one knows please give me a hint? Thank you so much! Kind Regards Numa --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]