You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Michael Siebert <ms...@o2online.de> on 2006/11/29 10:57:17 UTC

Problems with the UTF-8 standard

Hi All,

I have the following problem:

My html-templates are designed with the UTF-8 standard
For example the german 'ä' is coded as '&auml;'
But if the tapestry engine parses a submit-button component with an 'ä'
within the value (or label), this letter isn't parsed as 'ä' but as '&auml;'
because the '&' is parsed as '&amp;' and the rest as 'auml;' so the complete
letter is transformed as '&amp;auml;' and this is the reason for the wrong
view.

How can I deactivated the automatic parsing of the '&' and show the engine
that the value of the submit-button is in UTF-8 standard?
The server runs with the UTF-8 standard and I have no chance to change this.
The css-file also has the UTF-8 code as every html-template. 

I'm working with the Version 3.0.3.

Thank you very much in advance for your help!!

Best regards
Mike


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


Re: Re: Problems with the UTF-8 standard

Posted by Sam Gendler <sg...@ideasculptor.com>.
But, utf-8 vs html entity aside (and cyrille has it right), you can
tell tapestry not to escape html characters in an Insert component by
using the 'raw' attribute and setting it to true. That will cause the
msg to be copied directly to the outputstream, including characters
like '&,' which should fix your problem right up.

--sam


On 11/29/06, Cyrille37 <cy...@gmail.com> wrote:
> Michael Siebert a écrit :
> > Hi All,
> >
> > I have the following problem:
> >
> > My html-templates are designed with the UTF-8 standard
> > For example the german 'ä' is coded as '&auml;'
> >
> Hello,
>
> I think '&auml;' is not from the UTF-8 standard but a HTML entitie.
>
> If all you pages are encoded in UTF-8 and html page header declare a
> charset=utf-8 you do not need to use HTML Entities.
>
> regards,
> cyrille
>
> > But if the tapestry engine parses a submit-button component with an 'ä'
> > within the value (or label), this letter isn't parsed as 'ä' but as '&auml;'
> > because the '&' is parsed as '&amp;' and the rest as 'auml;' so the complete
> > letter is transformed as '&amp;auml;' and this is the reason for the wrong
> > view.
> >
> > How can I deactivated the automatic parsing of the '&' and show the engine
> > that the value of the submit-button is in UTF-8 standard?
> > The server runs with the UTF-8 standard and I have no chance to change this.
> > The css-file also has the UTF-8 code as every html-template.
> >
> > I'm working with the Version 3.0.3.
> >
> > Thank you very much in advance for your help!!
> >
> > Best regards
> > Mike
> >
> >
>
>
> ---------------------------------------------------------------------
> 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: Problems with the UTF-8 standard

Posted by Cyrille37 <cy...@gmail.com>.
Michael Siebert a écrit :
> Hi All,
>
> I have the following problem:
>
> My html-templates are designed with the UTF-8 standard
> For example the german 'ä' is coded as '&auml;'
>   
Hello,

I think '&auml;' is not from the UTF-8 standard but a HTML entitie.

If all you pages are encoded in UTF-8 and html page header declare a 
charset=utf-8 you do not need to use HTML Entities.

regards,
cyrille

> But if the tapestry engine parses a submit-button component with an 'ä'
> within the value (or label), this letter isn't parsed as 'ä' but as '&auml;'
> because the '&' is parsed as '&amp;' and the rest as 'auml;' so the complete
> letter is transformed as '&amp;auml;' and this is the reason for the wrong
> view.
>
> How can I deactivated the automatic parsing of the '&' and show the engine
> that the value of the submit-button is in UTF-8 standard?
> The server runs with the UTF-8 standard and I have no chance to change this.
> The css-file also has the UTF-8 code as every html-template. 
>
> I'm working with the Version 3.0.3.
>
> Thank you very much in advance for your help!!
>
> Best regards
> Mike
>
>   


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


Re: AW: Problems with the UTF-8 standard

Posted by Sam Gendler <sg...@ideasculptor.com>.
You can't do that if you want localization, though.  Really, the best
way to solve this is to just use a multi-byte character encoding to
put messages in the .properties file.  That means writing them so that
they look correct when viewed with a multi-byte capable text editor.
Assuming that Java's default charset matches the charset used to
encode your properties file, then they characters will be correctly
included in the html document and escaped as necessary.  Be careful,
because the default charset in windows and mac is not UTF-8 and is
unique to the platform in question.  This means that if you don't use
UTF-8, you are likely to wind up with pages that look correct in your
OS, but have question marks and other extraneous characters in any
other system.  Better to force java to use UTF-8 and then encode
everything in UTF-8.  Starting tomcat with -Dfile.encoding=UTF-8 in
your environment does the trick.

--sam




On 11/29/06, Holger Stolzenberg <h....@ewerk.com> wrote:
> I had a similar problem. I am using tap4.0.2 but maybe this helps. I think you should try to specify the submit as an explicit component in the .page with the value as a component binding, like the following example:
>
> <component id="MySubmit" type="Submit">
>         <binding name="value" value="literal:Ändern" />
>         <binding .... />
> </component>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Michael Siebert [mailto:msiebert@o2online.de]
> Gesendet: Mittwoch, 29. November 2006 10:57
> An: users@tapestry.apache.org
> Betreff: Problems with the UTF-8 standard
>
> Hi All,
>
> I have the following problem:
>
> My html-templates are designed with the UTF-8 standard For example the german 'ä' is coded as '&auml;'
> But if the tapestry engine parses a submit-button component with an 'ä'
> within the value (or label), this letter isn't parsed as 'ä' but as '&auml;'
> because the '&' is parsed as '&amp;' and the rest as 'auml;' so the complete letter is transformed as '&amp;auml;' and this is the reason for the wrong view.
>
> How can I deactivated the automatic parsing of the '&' and show the engine that the value of the submit-button is in UTF-8 standard?
> The server runs with the UTF-8 standard and I have no chance to change this.
> The css-file also has the UTF-8 code as every html-template.
>
> I'm working with the Version 3.0.3.
>
> Thank you very much in advance for your help!!
>
> Best regards
> Mike
>
>
> ---------------------------------------------------------------------
> 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: AW: Problems with the UTF-8 standard

Posted by Nick Westgate <ni...@key-planning.co.jp>.
That probably helps you if you are declaring the .page encoding to be UTF-8.
I.e.
<?xml version="1.0" encoding="UTF-8"?>

But you can set the encoding for templates globally by setting a property in
the .application file (and also locally for libraries, pages etc) with:
     <property name="org.apache.tapestry.template-encoding" value="UTF-8"/>

As mentioned by others, this has nothing to do with HTML entities.
Tapestry's default encoding is ISO-8859-1. (At least for T3.)

Cheers,
Nick.


Holger Stolzenberg wrote:
> I had a similar problem. I am using tap4.0.2 but maybe this helps. I think you should try to specify the submit as an explicit component in the .page with the value as a component binding, like the following example:
> 
> <component id="MySubmit" type="Submit">
> 	<binding name="value" value="literal:Ändern" />
> 	<binding .... />
> </component> 
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Michael Siebert [mailto:msiebert@o2online.de] 
> Gesendet: Mittwoch, 29. November 2006 10:57
> An: users@tapestry.apache.org
> Betreff: Problems with the UTF-8 standard
> 
> Hi All,
> 
> I have the following problem:
> 
> My html-templates are designed with the UTF-8 standard For example the german 'ä' is coded as '&auml;'
> But if the tapestry engine parses a submit-button component with an 'ä'
> within the value (or label), this letter isn't parsed as 'ä' but as '&auml;'
> because the '&' is parsed as '&amp;' and the rest as 'auml;' so the complete letter is transformed as '&amp;auml;' and this is the reason for the wrong view.
> 
> How can I deactivated the automatic parsing of the '&' and show the engine that the value of the submit-button is in UTF-8 standard?
> The server runs with the UTF-8 standard and I have no chance to change this.
> The css-file also has the UTF-8 code as every html-template. 
> 
> I'm working with the Version 3.0.3.
> 
> Thank you very much in advance for your help!!
> 
> Best regards
> Mike
> 
> 
> ---------------------------------------------------------------------
> 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


AW: Problems with the UTF-8 standard

Posted by Holger Stolzenberg <h....@ewerk.com>.
I had a similar problem. I am using tap4.0.2 but maybe this helps. I think you should try to specify the submit as an explicit component in the .page with the value as a component binding, like the following example:

<component id="MySubmit" type="Submit">
	<binding name="value" value="literal:Ändern" />
	<binding .... />
</component> 


-----Ursprüngliche Nachricht-----
Von: Michael Siebert [mailto:msiebert@o2online.de] 
Gesendet: Mittwoch, 29. November 2006 10:57
An: users@tapestry.apache.org
Betreff: Problems with the UTF-8 standard

Hi All,

I have the following problem:

My html-templates are designed with the UTF-8 standard For example the german 'ä' is coded as '&auml;'
But if the tapestry engine parses a submit-button component with an 'ä'
within the value (or label), this letter isn't parsed as 'ä' but as '&auml;'
because the '&' is parsed as '&amp;' and the rest as 'auml;' so the complete letter is transformed as '&amp;auml;' and this is the reason for the wrong view.

How can I deactivated the automatic parsing of the '&' and show the engine that the value of the submit-button is in UTF-8 standard?
The server runs with the UTF-8 standard and I have no chance to change this.
The css-file also has the UTF-8 code as every html-template. 

I'm working with the Version 3.0.3.

Thank you very much in advance for your help!!

Best regards
Mike


---------------------------------------------------------------------
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