You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Christoph Jäger <ch...@derwald.at> on 2008/12/22 23:48:28 UTC

T5: encoding issues

Hi,

I have a strange issue with character encoding. I use Tapestry 5 on a  
Tomcat 6.0.18 installation. No difference between java5 or java6,  
MacOSX or Linux.

Special characters on my pages look fine when they come from a .tml  
file, whne they come from a .properties file used for translations,  
and when they come from a database. They get garbled however if they  
come directly from some Java class. As an example a page class with  
the following method:

public String getSomeString() {
   return "Water boils at 100 °C.";
}

and this in the corresponding .tml file:

Remember: ${someString}

creates output like:

Remember: Water boils at 100°C.

Maybe it's not even a Tapestry issue, but a Tomcat one?

Thanks,

Christoph Jäger



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [OT] Re: T5: encoding issues

Posted by bigcache1 <sh...@gmail.com>.
Thanks a lot, man! That helped.

I did:
glassfish@Ubuntu-1110-oneiric-64-minimal:~$ bin/asadmin --secure
create-jvm-options -- -Dfile.encoding=utf-8
and stop-domain, start-domain.
I just thought that previous comment was referring to some system jvm
option. 

--
View this message in context: http://tapestry.1045711.n5.nabble.com/T5-encoding-issues-tp2427143p5571995.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [OT] Re: T5: encoding issues

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
No. You need to add this into JVM options tab in glassfish and make sure it's on the command line when you do a ps. 



On Mar 16, 2012, at 1:15 PM, bigcache1 <sh...@gmail.com> wrote:

> I added this option to maven.
> mvn install -Dfile.encoding=utf-8
> Am I right?
> 
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/T5-encoding-issues-tp2427143p5571968.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [OT] Re: T5: encoding issues

Posted by bigcache1 <sh...@gmail.com>.
I added this option to maven.
mvn install -Dfile.encoding=utf-8
Am I right?

--
View this message in context: http://tapestry.1045711.n5.nabble.com/T5-encoding-issues-tp2427143p5571968.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [OT] Re: T5: encoding issues

Posted by Josh Canfield <jo...@gmail.com>.
Did you try adding -Dfile.encoding=utf-8 to the jvm command line?


On Fri, Mar 16, 2012 at 10:02 AM, bigcache1 <sh...@gmail.com> wrote:
> BUMP!!
>
> I've recently updated my app to the Tapestry 5.3
> Everything works great, thanks to all developers.
> Just have a little problem with encoding of russian symbols in tml files.
> Instead of russian or just wrong "chinese" symbols, I get this ????? ???
> ????? ?.
>
> This is only in case when russian letters are in .tml file.
> When they are returned values, or from .properties files - everything is ok.
> File encodings:
> .tml - utf-8
> .properties ISO-8859-1
> .java - utf-8
> mysql tables - utf-8
>
> Server configuration:
> Ubuntu 11.10 ru and en locales (utf8) installed. I see russian in .tml on
> the terminal.
> Glassfish 3.1.1
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/T5-encoding-issues-tp2427143p5571931.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [OT] Re: T5: encoding issues

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Fri, 16 Mar 2012 14:02:40 -0300, bigcache1 <sh...@gmail.com>  
wrote:

> This is only in case when russian letters are in .tml file.
> When they are returned values, or from .properties files - everything is  
> ok.
> File encodings:
> .tml - utf-8
> .properties ISO-8859-1

Not ok. For Tapestry, .properties files should be UTF-8.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [OT] Re: T5: encoding issues

Posted by bigcache1 <sh...@gmail.com>.
BUMP!!

I've recently updated my app to the Tapestry 5.3
Everything works great, thanks to all developers.
Just have a little problem with encoding of russian symbols in tml files.
Instead of russian or just wrong "chinese" symbols, I get this ????? ???
????? ?. 

This is only in case when russian letters are in .tml file.
When they are returned values, or from .properties files - everything is ok.
File encodings:
.tml - utf-8
.properties ISO-8859-1
.java - utf-8
mysql tables - utf-8

Server configuration:
Ubuntu 11.10 ru and en locales (utf8) installed. I see russian in .tml on
the terminal.
Glassfish 3.1.1

--
View this message in context: http://tapestry.1045711.n5.nabble.com/T5-encoding-issues-tp2427143p5571931.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [OT] Re: T5: encoding issues

Posted by Kalle Korhonen <ka...@gmail.com>.
Use -Dfile.encoding=utf-8 when starting up Java; you can set it as JVM
default properties in Eclipse.

Kalle

On Tue, Jan 6, 2009 at 11:42 AM, Christoph Jäger <
christoph.jaeger@derwald.at> wrote:

> Hi Lutz,
>
> thanks for your thoughts. As far as I can see, the encoding in the
> generated HTML is correct (everything works nicely if the special characters
> come from some different place than a compiled .java file). Additionally, I
> found the same behaviour in graphics generated using JFreeChart (had a m³
> there, which would never render correctly), so it does not seem to be a
> problem with HTML encoding set incorrectly.
>
> I use Eclipse to build my project. The project is organized as several
> plugins, which would be valid OSGi bundles, but I just use Eclipse to export
> the bundles and use them as plain .jar files, which I put into a .war. For
> creating the .war, I use ant, but I think it's already too late here, from
> what I learned and tried out in the past few days, I think Eclipse treats my
> .java files as if they were MACROMAN encoded and "translates" them when
> compiling (I get the same weird characters when I use iconv to convert my
> (UTF-8 encoded) .java files from MACROMAN to UTF-8). The strange thing is:
> if I ask Eclipse about the .java files' properties, it tells me they are
> UTF-8, only the compiler thinks differently. I think the solution involves
> setting the file.encoding system property to UTF-8 (it is MACROMAN now if I
> query it from a java program, but changing the value after startup does not
> make a difference, so I need to set it before the JVM starts).
>
> But it is clearly NOT a tapestry issue, sorry for polluting this mailing
> list.
>
> I'll post a short note as soon as I find time to solve this issue (found a
> workaround now, and need to continue with my project).
>
> Thanks,
>
> Christoph
>
>
> On Jan 2, 2009, at 13:12 , Lutz Hühnken wrote:
>
>  Hm... I think there are many possible points of failure for the
>> encoding...
>>
>> - maybe your browser thinks the page is not utf-8. Is the encoding set
>> correctly either in a http response header or html meta tag?
>>
>> - what do you use for building your project? If you use maven, check
>> the "encoding" argument for the compiler plugin configuration. If it
>> is not set, maven will assume the source files are in the platform
>> default encoding, no matter what eclipse says.
>>
>> Also, as a quick workaround, you could use the html entity &deg; and
>> use t:outputRaw instead of the $ notation.
>>
>> hth,
>>
>> Lutz
>>
>>
>>
>> On Tue, Dec 23, 2008 at 10:24 PM, Christoph Jäger
>> <ch...@polleninfo.org> wrote:
>>
>>> Hi José,
>>>
>>> the java files seem to be UTF-8. At least Eclipse tells me so, and if I
>>> write some of the special characters to stdout (from a test case, not
>>> running in Tomcat), everything is fine.
>>>
>>> Thanks,
>>>
>>> Christoph
>>>
>>>
>>
>>
>>
>> --
>> altocon GmbH
>> http://www.altocon.de/
>> Software Development, Consulting
>> Hamburg, Germany
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

[OT] Re: T5: encoding issues

Posted by Christoph Jäger <ch...@derwald.at>.
Hi Lutz,

thanks for your thoughts. As far as I can see, the encoding in the  
generated HTML is correct (everything works nicely if the special  
characters come from some different place than a compiled .java file).  
Additionally, I found the same behaviour in graphics generated using  
JFreeChart (had a m³ there, which would never render correctly), so it  
does not seem to be a problem with HTML encoding set incorrectly.

I use Eclipse to build my project. The project is organized as several  
plugins, which would be valid OSGi bundles, but I just use Eclipse to  
export the bundles and use them as plain .jar files, which I put into  
a .war. For creating the .war, I use ant, but I think it's already too  
late here, from what I learned and tried out in the past few days, I  
think Eclipse treats my .java files as if they were MACROMAN encoded  
and "translates" them when compiling (I get the same weird characters  
when I use iconv to convert my (UTF-8 encoded) .java files from  
MACROMAN to UTF-8). The strange thing is: if I ask Eclipse about  
the .java files' properties, it tells me they are UTF-8, only the  
compiler thinks differently. I think the solution involves setting the  
file.encoding system property to UTF-8 (it is MACROMAN now if I query  
it from a java program, but changing the value after startup does not  
make a difference, so I need to set it before the JVM starts).

But it is clearly NOT a tapestry issue, sorry for polluting this  
mailing list.

I'll post a short note as soon as I find time to solve this issue  
(found a workaround now, and need to continue with my project).

Thanks,

Christoph

On Jan 2, 2009, at 13:12 , Lutz Hühnken wrote:

> Hm... I think there are many possible points of failure for the  
> encoding...
>
> - maybe your browser thinks the page is not utf-8. Is the encoding set
> correctly either in a http response header or html meta tag?
>
> - what do you use for building your project? If you use maven, check
> the "encoding" argument for the compiler plugin configuration. If it
> is not set, maven will assume the source files are in the platform
> default encoding, no matter what eclipse says.
>
> Also, as a quick workaround, you could use the html entity &deg; and
> use t:outputRaw instead of the $ notation.
>
> hth,
>
> Lutz
>
>
>
> On Tue, Dec 23, 2008 at 10:24 PM, Christoph Jäger
> <ch...@polleninfo.org> wrote:
>> Hi José,
>>
>> the java files seem to be UTF-8. At least Eclipse tells me so, and  
>> if I
>> write some of the special characters to stdout (from a test case, not
>> running in Tomcat), everything is fine.
>>
>> Thanks,
>>
>> Christoph
>>
>
>
>
>
> -- 
> altocon GmbH
> http://www.altocon.de/
> Software Development, Consulting
> Hamburg, Germany



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: encoding issues

Posted by Lutz Hühnken <lh...@googlemail.com>.
Hm... I think there are many possible points of failure for the encoding...

- maybe your browser thinks the page is not utf-8. Is the encoding set
correctly either in a http response header or html meta tag?

- what do you use for building your project? If you use maven, check
the "encoding" argument for the compiler plugin configuration. If it
is not set, maven will assume the source files are in the platform
default encoding, no matter what eclipse says.

Also, as a quick workaround, you could use the html entity &deg; and
use t:outputRaw instead of the $ notation.

hth,

Lutz



On Tue, Dec 23, 2008 at 10:24 PM, Christoph Jäger
<ch...@polleninfo.org> wrote:
> Hi José,
>
> the java files seem to be UTF-8. At least Eclipse tells me so, and if I
> write some of the special characters to stdout (from a test case, not
> running in Tomcat), everything is fine.
>
> Thanks,
>
> Christoph
>




-- 
altocon GmbH
http://www.altocon.de/
Software Development, Consulting
Hamburg, Germany

Re: T5: encoding issues

Posted by Christoph Jäger <ch...@polleninfo.org>.
Hi José,

the java files seem to be UTF-8. At least Eclipse tells me so, and if  
I write some of the special characters to stdout (from a test case,  
not running in Tomcat), everything is fine.

Thanks,

Christoph

On Dec 23, 2008, at 15:05 , José Paumard wrote:

> Hello Christoph,
>
> Just a tought, but could it come from the encoding of your .java  
> file ? It is UTF-8 too, as .tml and .propreties are ?
>
> José
>
> Christoph Jäger a écrit :
>>
>> Hi,
>>
>> I have a strange issue with character encoding. I use Tapestry 5 on  
>> a Tomcat 6.0.18 installation. No difference between java5 or java6,  
>> MacOSX or Linux.
>>
>> Special characters on my pages look fine when they come from a .tml  
>> file, whne they come from a .properties file used for translations,  
>> and when they come from a database. They get garbled however if  
>> they come directly from some Java class. As an example a page class  
>> with the following method:
>>
>> public String getSomeString() {
>>  return "Water boils at 100 °C.";
>> }
>>
>> and this in the corresponding .tml file:
>>
>> Remember: ${someString}
>>
>> creates output like:
>>
>> Remember: Water boils at 100°C.
>>
>> Maybe it's not even a Tapestry issue, but a Tomcat one?
>>
>> Thanks,
>>
>> Christoph Jäger
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: encoding issues

Posted by José Paumard <Jo...@orange.fr>.
Hello Christoph,

Just a tought, but could it come from the encoding of your .java file ? 
It is UTF-8 too, as .tml and .propreties are ?

José

Christoph Jäger a écrit :
>
> Hi,
>
> I have a strange issue with character encoding. I use Tapestry 5 on a 
> Tomcat 6.0.18 installation. No difference between java5 or java6, 
> MacOSX or Linux.
>
> Special characters on my pages look fine when they come from a .tml 
> file, whne they come from a .properties file used for translations, 
> and when they come from a database. They get garbled however if they 
> come directly from some Java class. As an example a page class with 
> the following method:
>
> public String getSomeString() {
>   return "Water boils at 100 °C.";
> }
>
> and this in the corresponding .tml file:
>
> Remember: ${someString}
>
> creates output like:
>
> Remember: Water boils at 100°C.
>
> Maybe it's not even a Tapestry issue, but a Tomcat one?
>
> Thanks,
>
> Christoph Jäger
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org