You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Lubos and Alena Pochman <po...@gmail.com> on 2006/01/20 23:59:18 UTC

Problems to make Tapestry talking different languages

I use Tapestry 3.02 and when I try to enter non-english/ansi text like
"Génération" into text field (<input>), I get from Tapestry when
creating the Java object that holds the data [G, Ã, (c), n, Ã, (c), r,
a, t, i, o, n] or in bytes [71, 61, 87, 110, 61, 87, 114, 97, 116,
105, 111, 110], while I should get [G, é, n, é, r, a, t, i, o, n] or
in bytes [71, 23, 110, 23, 114, 97, 116, 105, 111, 110].

When I force the é char in debugger (Change value in Eclipse), when
the Java object is created, everything else (rest of the system,
display, storage) works OK. That is why I think it is Tapestry/Ognl
input handling and Java object mapping.

I set all the obvious/recommended utf-8 encoding.

Any Tapestry multi-language experts?

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


Re: Problems to make Tapestry talking different languages

Posted by Lubos and Alena Pochman <po...@gmail.com>.
What is the Shell? I tested it on (Windows) Eclipse internal browser, Maxton
(IE engine),
IE and Firefox 1.5 with same results.

Yes tapestry puts <meta> in <header> but not as a first <meta> tag as I said
in  my previous post.
And I have read somewhere that <meta http-equiv="Content-Type" ...> has to
be first meta tag in header,
otherwise it is ignored. But I did not tested it.

Lubos

On 1/21/06, Mind Bridge <mi...@yahoo.com> wrote:
>
> One other thing -- do you use Shell? I remember that IE did not respect
> the HTTP  headers (Firefox does though) and it was necessary to include
> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
> (what whatever the OutputEncoding is set to) in the HTML of the page.
> Shell does precisely that. Tapestry also places a content-type parameter
> in the HTTP header that includes the output encoding.
>
> Lubos and Alena Pochman wrote:
> > I did not set either property:
> >
> > org.apache.tapestry.output-encoding (should default to UTF-8)
> > or
> > org.apache.tapestry.template-encoding (should default to ISO-8859-1)
> >
> > But when viewing the source of the html generated by Tapestry note that
> > charset is set to UTF-8 (properly), but it is the second <meta> in
> <head>.
> >
> > Lubos
> >
> >
> > On 1/21/06, Mind Bridge <mi...@yahoo.com> wrote:
> >
> >>> I have fixed the charset encoding problem in Tapestry 3.02. The
> problem
> >>>
> >> is
> >>
> >>> that Tapestry generated web page sets charset to ISO-8859-1.
> >>>
> >> This is very strange, I am pretty sure it does not use ISO-8859-1 and
> >> the default encoding is UTF-8. Have you changed output-encoding  and
> >> template-encoding by any chance? See
> >>
> >>
> http://jakarta.apache.org/tapestry/3.0.3/doc/TapestryUsersGuide/configuration.search-path.html
> >> and
> >>
> >>
> http://jakarta.apache.org/tapestry/3.0.3/doc/TapestryUsersGuide/configuration.character-sets.html
> >> for details
> >>
> >> Lubos and Alena Pochman wrote:
> >>
> >>> I have fixed the charset encoding problem in Tapestry 3.02. The
> problem
> >>>
> >> is
> >>
> >>> that Tapestry generated web page sets charset to ISO-8859-1.
> >>>
> >>> I've created CharsetFilter (servlet container filter, not Tapestry's),
> >>>
> >> and
> >>
> >>> force UTF-8 encoding on both request and response.
> >>>
> >>>  public void doFilter(ServletRequest servletRequest, ServletResponse
> >>> servletResponse,
> >>>             FilterChain filterChain) throws IOException,
> >>>
> >> ServletException {
> >>
> >>>   try  {
> >>>             servletRequest.setCharacterEncoding("UTF-8");
> >>>             servletResponse.setContentType( "text/html; charset=UTF-8"
> >>>
> >> );
> >>
> >>> I found the solution after digging at Google
> >>> (http://forum.java.sun.com/thread.jspa?threadID=539309&tstart=0
> >>> )
> >>> and by getting response to my Luntbuild blog entry
> >>>
> >>>
> >>
> http://jroller.com/page/luntbuild?entry=problems_to_make_tapestry_talking.
> >>
> >>> I think the problem is that Tapestry, when it generates the html page
> >>>
> >> does
> >>
> >>> not put Content-Type meta tag first:
> >>>
> >>> <head>
> >>> <meta name="generator" content="Tapestry Application Framework,
> version
> >>> 3.0.2"/>
> >>> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
> >>>
> >>> That might cause, that it is ignored (I have read it somewhere).
> >>>
> >>>
> >>> On 1/20/06, Lubos and Alena Pochman <po...@gmail.com> wrote:
> >>>
> >>>
> >>>> I use Tapestry 3.02 and when I try to enter non-english/ansi text
> like
> >>>> "Génération" into text field (<input>), I get from Tapestry when
> >>>> creating the Java object that holds the data [G, Ã, (c), n, Ã, (c),
> r,
> >>>> a, t, i, o, n] or in bytes [71, 61, 87, 110, 61, 87, 114, 97, 116,
> >>>> 105, 111, 110], while I should get [G, é, n, é, r, a, t, i, o, n] or
> >>>> in bytes [71, 23, 110, 23, 114, 97, 116, 105, 111, 110].
> >>>>
> >>>> When I force the é char in debugger (Change value in Eclipse), when
> >>>> the Java object is created, everything else (rest of the system,
> >>>> display, storage) works OK. That is why I think it is Tapestry/Ognl
> >>>> input handling and Java object mapping.
> >>>>
> >>>> I set all the obvious/recommended utf-8 encoding.
> >>>>
> >>>> Any Tapestry multi-language experts?
> >>>>
> >>>>
> >>>>
> >>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>
> >>
> >>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

Re: Problems to make Tapestry talking different languages

Posted by Mind Bridge <mi...@yahoo.com>.
One other thing -- do you use Shell? I remember that IE did not respect 
the HTTP  headers (Firefox does though) and it was necessary to include 
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/> 
(what whatever the OutputEncoding is set to) in the HTML of the page. 
Shell does precisely that. Tapestry also places a content-type parameter 
in the HTTP header that includes the output encoding.

Lubos and Alena Pochman wrote:
> I did not set either property:
>
> org.apache.tapestry.output-encoding (should default to UTF-8)
> or
> org.apache.tapestry.template-encoding (should default to ISO-8859-1)
>
> But when viewing the source of the html generated by Tapestry note that
> charset is set to UTF-8 (properly), but it is the second <meta> in <head>.
>
> Lubos
>
>
> On 1/21/06, Mind Bridge <mi...@yahoo.com> wrote:
>   
>>> I have fixed the charset encoding problem in Tapestry 3.02. The problem
>>>       
>> is
>>     
>>> that Tapestry generated web page sets charset to ISO-8859-1.
>>>       
>> This is very strange, I am pretty sure it does not use ISO-8859-1 and
>> the default encoding is UTF-8. Have you changed output-encoding  and
>> template-encoding by any chance? See
>>
>> http://jakarta.apache.org/tapestry/3.0.3/doc/TapestryUsersGuide/configuration.search-path.html
>> and
>>
>> http://jakarta.apache.org/tapestry/3.0.3/doc/TapestryUsersGuide/configuration.character-sets.html
>> for details
>>
>> Lubos and Alena Pochman wrote:
>>     
>>> I have fixed the charset encoding problem in Tapestry 3.02. The problem
>>>       
>> is
>>     
>>> that Tapestry generated web page sets charset to ISO-8859-1.
>>>
>>> I've created CharsetFilter (servlet container filter, not Tapestry's),
>>>       
>> and
>>     
>>> force UTF-8 encoding on both request and response.
>>>
>>>  public void doFilter(ServletRequest servletRequest, ServletResponse
>>> servletResponse,
>>>             FilterChain filterChain) throws IOException,
>>>       
>> ServletException {
>>     
>>>   try  {
>>>             servletRequest.setCharacterEncoding("UTF-8");
>>>             servletResponse.setContentType( "text/html; charset=UTF-8"
>>>       
>> );
>>     
>>> I found the solution after digging at Google
>>> (http://forum.java.sun.com/thread.jspa?threadID=539309&tstart=0
>>> )
>>> and by getting response to my Luntbuild blog entry
>>>
>>>       
>> http://jroller.com/page/luntbuild?entry=problems_to_make_tapestry_talking.
>>     
>>> I think the problem is that Tapestry, when it generates the html page
>>>       
>> does
>>     
>>> not put Content-Type meta tag first:
>>>
>>> <head>
>>> <meta name="generator" content="Tapestry Application Framework, version
>>> 3.0.2"/>
>>> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
>>>
>>> That might cause, that it is ignored (I have read it somewhere).
>>>
>>>
>>> On 1/20/06, Lubos and Alena Pochman <po...@gmail.com> wrote:
>>>
>>>       
>>>> I use Tapestry 3.02 and when I try to enter non-english/ansi text like
>>>> "Génération" into text field (<input>), I get from Tapestry when
>>>> creating the Java object that holds the data [G, Ã, (c), n, Ã, (c), r,
>>>> a, t, i, o, n] or in bytes [71, 61, 87, 110, 61, 87, 114, 97, 116,
>>>> 105, 111, 110], while I should get [G, é, n, é, r, a, t, i, o, n] or
>>>> in bytes [71, 23, 110, 23, 114, 97, 116, 105, 111, 110].
>>>>
>>>> When I force the é char in debugger (Change value in Eclipse), when
>>>> the Java object is created, everything else (rest of the system,
>>>> display, storage) works OK. That is why I think it is Tapestry/Ognl
>>>> input handling and Java object mapping.
>>>>
>>>> I set all the obvious/recommended utf-8 encoding.
>>>>
>>>> Any Tapestry multi-language experts?
>>>>
>>>>
>>>>         
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>     
>
>   

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


Re: Problems to make Tapestry talking different languages

Posted by Lubos and Alena Pochman <po...@gmail.com>.
I did not set either property:

org.apache.tapestry.output-encoding (should default to UTF-8)
or
org.apache.tapestry.template-encoding (should default to ISO-8859-1)

But when viewing the source of the html generated by Tapestry note that
charset is set to UTF-8 (properly), but it is the second <meta> in <head>.

Lubos


On 1/21/06, Mind Bridge <mi...@yahoo.com> wrote:
>
> > I have fixed the charset encoding problem in Tapestry 3.02. The problem
> is
> > that Tapestry generated web page sets charset to ISO-8859-1.
>
> This is very strange, I am pretty sure it does not use ISO-8859-1 and
> the default encoding is UTF-8. Have you changed output-encoding  and
> template-encoding by any chance? See
>
> http://jakarta.apache.org/tapestry/3.0.3/doc/TapestryUsersGuide/configuration.search-path.html
> and
>
> http://jakarta.apache.org/tapestry/3.0.3/doc/TapestryUsersGuide/configuration.character-sets.html
> for details
>
> Lubos and Alena Pochman wrote:
> > I have fixed the charset encoding problem in Tapestry 3.02. The problem
> is
> > that Tapestry generated web page sets charset to ISO-8859-1.
> >
> > I've created CharsetFilter (servlet container filter, not Tapestry's),
> and
> > force UTF-8 encoding on both request and response.
> >
> >  public void doFilter(ServletRequest servletRequest, ServletResponse
> > servletResponse,
> >             FilterChain filterChain) throws IOException,
> ServletException {
> >   try  {
> >             servletRequest.setCharacterEncoding("UTF-8");
> >             servletResponse.setContentType( "text/html; charset=UTF-8"
> );
> >
> > I found the solution after digging at Google
> > (http://forum.java.sun.com/thread.jspa?threadID=539309&tstart=0
> > )
> > and by getting response to my Luntbuild blog entry
> >
> http://jroller.com/page/luntbuild?entry=problems_to_make_tapestry_talking.
> >
> > I think the problem is that Tapestry, when it generates the html page
> does
> > not put Content-Type meta tag first:
> >
> > <head>
> > <meta name="generator" content="Tapestry Application Framework, version
> > 3.0.2"/>
> > <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
> >
> > That might cause, that it is ignored (I have read it somewhere).
> >
> >
> > On 1/20/06, Lubos and Alena Pochman <po...@gmail.com> wrote:
> >
> >> I use Tapestry 3.02 and when I try to enter non-english/ansi text like
> >> "Génération" into text field (<input>), I get from Tapestry when
> >> creating the Java object that holds the data [G, Ã, (c), n, Ã, (c), r,
> >> a, t, i, o, n] or in bytes [71, 61, 87, 110, 61, 87, 114, 97, 116,
> >> 105, 111, 110], while I should get [G, é, n, é, r, a, t, i, o, n] or
> >> in bytes [71, 23, 110, 23, 114, 97, 116, 105, 111, 110].
> >>
> >> When I force the é char in debugger (Change value in Eclipse), when
> >> the Java object is created, everything else (rest of the system,
> >> display, storage) works OK. That is why I think it is Tapestry/Ognl
> >> input handling and Java object mapping.
> >>
> >> I set all the obvious/recommended utf-8 encoding.
> >>
> >> Any Tapestry multi-language experts?
> >>
> >>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

Re: Problems to make Tapestry talking different languages

Posted by Mind Bridge <mi...@yahoo.com>.
> I have fixed the charset encoding problem in Tapestry 3.02. The problem is
> that Tapestry generated web page sets charset to ISO-8859-1.

This is very strange, I am pretty sure it does not use ISO-8859-1 and 
the default encoding is UTF-8. Have you changed output-encoding  and 
template-encoding by any chance? See
http://jakarta.apache.org/tapestry/3.0.3/doc/TapestryUsersGuide/configuration.search-path.html
and
http://jakarta.apache.org/tapestry/3.0.3/doc/TapestryUsersGuide/configuration.character-sets.html
for details

Lubos and Alena Pochman wrote:
> I have fixed the charset encoding problem in Tapestry 3.02. The problem is
> that Tapestry generated web page sets charset to ISO-8859-1.
>
> I've created CharsetFilter (servlet container filter, not Tapestry's), and
> force UTF-8 encoding on both request and response.
>
>  public void doFilter(ServletRequest servletRequest, ServletResponse
> servletResponse,
>             FilterChain filterChain) throws IOException, ServletException {
>   try  {
>             servletRequest.setCharacterEncoding("UTF-8");
>             servletResponse.setContentType( "text/html; charset=UTF-8" );
>
> I found the solution after digging at Google
> (http://forum.java.sun.com/thread.jspa?threadID=539309&tstart=0
> )
> and by getting response to my Luntbuild blog entry
> http://jroller.com/page/luntbuild?entry=problems_to_make_tapestry_talking.
>
> I think the problem is that Tapestry, when it generates the html page does
> not put Content-Type meta tag first:
>
> <head>
> <meta name="generator" content="Tapestry Application Framework, version
> 3.0.2"/>
> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
>
> That might cause, that it is ignored (I have read it somewhere).
>
>
> On 1/20/06, Lubos and Alena Pochman <po...@gmail.com> wrote:
>   
>> I use Tapestry 3.02 and when I try to enter non-english/ansi text like
>> "Génération" into text field (<input>), I get from Tapestry when
>> creating the Java object that holds the data [G, Ã, (c), n, Ã, (c), r,
>> a, t, i, o, n] or in bytes [71, 61, 87, 110, 61, 87, 114, 97, 116,
>> 105, 111, 110], while I should get [G, é, n, é, r, a, t, i, o, n] or
>> in bytes [71, 23, 110, 23, 114, 97, 116, 105, 111, 110].
>>
>> When I force the é char in debugger (Change value in Eclipse), when
>> the Java object is created, everything else (rest of the system,
>> display, storage) works OK. That is why I think it is Tapestry/Ognl
>> input handling and Java object mapping.
>>
>> I set all the obvious/recommended utf-8 encoding.
>>
>> Any Tapestry multi-language experts?
>>
>>     
>
>   

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


Re: Problems to make Tapestry talking different languages

Posted by Lubos and Alena Pochman <po...@gmail.com>.
I have fixed the charset encoding problem in Tapestry 3.02. The problem is
that Tapestry generated web page sets charset to ISO-8859-1.

I've created CharsetFilter (servlet container filter, not Tapestry's), and
force UTF-8 encoding on both request and response.

 public void doFilter(ServletRequest servletRequest, ServletResponse
servletResponse,
            FilterChain filterChain) throws IOException, ServletException {
  try  {
            servletRequest.setCharacterEncoding("UTF-8");
            servletResponse.setContentType( "text/html; charset=UTF-8" );

I found the solution after digging at Google
(http://forum.java.sun.com/thread.jspa?threadID=539309&tstart=0
)
and by getting response to my Luntbuild blog entry
http://jroller.com/page/luntbuild?entry=problems_to_make_tapestry_talking.

I think the problem is that Tapestry, when it generates the html page does
not put Content-Type meta tag first:

<head>
<meta name="generator" content="Tapestry Application Framework, version
3.0.2"/>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>

That might cause, that it is ignored (I have read it somewhere).


On 1/20/06, Lubos and Alena Pochman <po...@gmail.com> wrote:
>
> I use Tapestry 3.02 and when I try to enter non-english/ansi text like
> "Génération" into text field (<input>), I get from Tapestry when
> creating the Java object that holds the data [G, Ã, (c), n, Ã, (c), r,
> a, t, i, o, n] or in bytes [71, 61, 87, 110, 61, 87, 114, 97, 116,
> 105, 111, 110], while I should get [G, é, n, é, r, a, t, i, o, n] or
> in bytes [71, 23, 110, 23, 114, 97, 116, 105, 111, 110].
>
> When I force the é char in debugger (Change value in Eclipse), when
> the Java object is created, everything else (rest of the system,
> display, storage) works OK. That is why I think it is Tapestry/Ognl
> input handling and Java object mapping.
>
> I set all the obvious/recommended utf-8 encoding.
>
> Any Tapestry multi-language experts?
>