You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by David Delbecq <de...@oma.be> on 2007/03/09 11:14:18 UTC

How to set response character encoding?

Hello,

i am trying to figure out how to set the response character encoding in
my jsf pages. I am using MyFaces+Facelets, the response by default seems
to be iso8859-1 and i'd like to set it to UTF-8, where do i configure this?

Thanks

Re: How to set response character encoding?

Posted by David Delbecq <de...@oma.be>.
Aren't filters a bit overkill for such work? Doesn't facelets have a
simple configuration parameter for this??
I have read mail where it's stated and fixed problem where myfaces does
not respect the character encoding rule configured in facelets, but i
can't find where in facelets to configure it...

En l'instant précis du 14/03/07 11:24, Cagatay Civici s'exprimait en ces
termes:
> Hi,
>
> A filter will help,
>
> http://www.jroller.com/page/mert?entry=utf_8_encoding_with_jsf
>
> Cagatay
>
> On 3/14/07, Christopher Cudennec <Sm...@gmx.net> wrote:
>>
>> Hi, you can use a filter. We successfully use
>> org.springframework.web.filter.CharacterEncodingFilter in our project.
>>
>> Cheers, Christopher
>>
>> David Delbecq schrieb:
>> > This instruction only refers to xml charset encoding used when reading
>> > it. Facelets does not use it as encoding for FacesContext.writer. Even
>> > with such instruction in my xml (anyway, all my xml are already
>> utf-8),
>> > facelets still send the response to client in iso-8859-1 charset
>> encoding.
>> >
>> > Other suggestions?
>> > En l'instant précis du 09/03/07 11:16, Roger Alix-Gaudreau s'exprimait
>> > en ces termes:
>> >
>> >> I am using Facelets as well, and we define the encoding in the XML
>> >> prolog at the top of the layout template file, as such:
>> >>
>> >> <?xml version="1.0" encoding="UTF-8"?>
>> >>
>> >> Roger Alix-Gaudreau
>> >>
>> >> -----Original Message-----
>> >> From: David Delbecq [mailto:delbd+jakarta@oma.be]
>> >> Sent: Friday, March 09, 2007 3:44 PM
>> >> To: MyFaces Discussion
>> >> Subject: How to set response character encoding?
>> >>
>> >> Hello,
>> >>
>> >> i am trying to figure out how to set the response character
>> encoding in
>> >> my jsf pages. I am using MyFaces+Facelets, the response by default
>> seems
>> >> to be iso8859-1 and i'd like to set it to UTF-8, where do i configure
>> >> this?
>> >>
>> >> Thanks
>> >>
>> >>
>> >
>> >
>> >
>>
>>


Re: How to set response character encoding?

Posted by Christopher Cudennec <Sm...@gmx.net>.
I was referring to 
https://facelets.dev.java.net/issues/show_bug.cgi?id=167 that still has 
status "NEW". Maybe I posted the wrong link ;).

David Delbecq schrieb:
> The issue you refer to was fixed (according to what i saw when i search
> this), however i can not find where they configured facelets character
> encoding to something else than "default behaviour".
> En l'instant précis du 14/03/07 12:34, Christopher Cudennec s'exprimait
> en ces termes:
>   
>> Hi, I had some issues setting the character encoding when I tried to
>> set up trinidad. The problem that I ran into is described similarly here:
>>
>> http://marc.theaimsgroup.com/?l=myfaces-user&m=116230903513566&w=2
>>
>> So using a filter seems to be the only choice left... any other opinions?
>>
>> Christopher
>>
>> David Delbecq schrieb:
>>     
>>> Aren't filters a bit overkill for such work? Doesn't facelets have a
>>> simple configuration parameter for this??
>>> I have read mail where it's stated and fixed problem where myfaces does
>>> not respect the character encoding rule configured in facelets, but i
>>> can't find where in facelets to configure it...
>>>
>>> En l'instant précis du 14/03/07 11:24, Cagatay Civici s'exprimait en ces
>>> termes:
>>>  
>>>       
>>>> Hi,
>>>>
>>>> A filter will help,
>>>>
>>>> http://www.jroller.com/page/mert?entry=utf_8_encoding_with_jsf
>>>>
>>>> Cagatay
>>>>
>>>> On 3/14/07, Christopher Cudennec <Sm...@gmx.net> wrote:
>>>>    
>>>>         
>>>>> Hi, you can use a filter. We successfully use
>>>>> org.springframework.web.filter.CharacterEncodingFilter in our project.
>>>>>
>>>>> Cheers, Christopher
>>>>>
>>>>> David Delbecq schrieb:
>>>>>      
>>>>>           
>>>>>> This instruction only refers to xml charset encoding used when
>>>>>> reading
>>>>>> it. Facelets does not use it as encoding for FacesContext.writer.
>>>>>> Even
>>>>>> with such instruction in my xml (anyway, all my xml are already
>>>>>>         
>>>>>>             
>>>>> utf-8),
>>>>>      
>>>>>           
>>>>>> facelets still send the response to client in iso-8859-1 charset
>>>>>>         
>>>>>>             
>>>>> encoding.
>>>>>      
>>>>>           
>>>>>> Other suggestions?
>>>>>> En l'instant précis du 09/03/07 11:16, Roger Alix-Gaudreau
>>>>>> s'exprimait
>>>>>> en ces termes:
>>>>>>
>>>>>>        
>>>>>>             
>>>>>>> I am using Facelets as well, and we define the encoding in the XML
>>>>>>> prolog at the top of the layout template file, as such:
>>>>>>>
>>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>>
>>>>>>> Roger Alix-Gaudreau
>>>>>>>
>>>>>>> -----Original Message-----
>>>>>>> From: David Delbecq [mailto:delbd+jakarta@oma.be]
>>>>>>> Sent: Friday, March 09, 2007 3:44 PM
>>>>>>> To: MyFaces Discussion
>>>>>>> Subject: How to set response character encoding?
>>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> i am trying to figure out how to set the response character
>>>>>>>           
>>>>>>>               
>>>>> encoding in
>>>>>      
>>>>>           
>>>>>>> my jsf pages. I am using MyFaces+Facelets, the response by default
>>>>>>>           
>>>>>>>               
>>>>> seems
>>>>>      
>>>>>           
>>>>>>> to be iso8859-1 and i'd like to set it to UTF-8, where do i
>>>>>>> configure
>>>>>>> this?
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>>
>>>>>>>           
>>>>>>>               
>>>>>>         
>>>>>>             
>>>>>       
>>>>>           
>>>
>>>   
>>>       
>
>
>   


Re: How to set response character encoding?

Posted by David Delbecq <de...@oma.be>.
The issue you refer to was fixed (according to what i saw when i search
this), however i can not find where they configured facelets character
encoding to something else than "default behaviour".
En l'instant précis du 14/03/07 12:34, Christopher Cudennec s'exprimait
en ces termes:
> Hi, I had some issues setting the character encoding when I tried to
> set up trinidad. The problem that I ran into is described similarly here:
>
> http://marc.theaimsgroup.com/?l=myfaces-user&m=116230903513566&w=2
>
> So using a filter seems to be the only choice left... any other opinions?
>
> Christopher
>
> David Delbecq schrieb:
>> Aren't filters a bit overkill for such work? Doesn't facelets have a
>> simple configuration parameter for this??
>> I have read mail where it's stated and fixed problem where myfaces does
>> not respect the character encoding rule configured in facelets, but i
>> can't find where in facelets to configure it...
>>
>> En l'instant précis du 14/03/07 11:24, Cagatay Civici s'exprimait en ces
>> termes:
>>  
>>> Hi,
>>>
>>> A filter will help,
>>>
>>> http://www.jroller.com/page/mert?entry=utf_8_encoding_with_jsf
>>>
>>> Cagatay
>>>
>>> On 3/14/07, Christopher Cudennec <Sm...@gmx.net> wrote:
>>>    
>>>> Hi, you can use a filter. We successfully use
>>>> org.springframework.web.filter.CharacterEncodingFilter in our project.
>>>>
>>>> Cheers, Christopher
>>>>
>>>> David Delbecq schrieb:
>>>>      
>>>>> This instruction only refers to xml charset encoding used when
>>>>> reading
>>>>> it. Facelets does not use it as encoding for FacesContext.writer.
>>>>> Even
>>>>> with such instruction in my xml (anyway, all my xml are already
>>>>>         
>>>> utf-8),
>>>>      
>>>>> facelets still send the response to client in iso-8859-1 charset
>>>>>         
>>>> encoding.
>>>>      
>>>>> Other suggestions?
>>>>> En l'instant précis du 09/03/07 11:16, Roger Alix-Gaudreau
>>>>> s'exprimait
>>>>> en ces termes:
>>>>>
>>>>>        
>>>>>> I am using Facelets as well, and we define the encoding in the XML
>>>>>> prolog at the top of the layout template file, as such:
>>>>>>
>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>
>>>>>> Roger Alix-Gaudreau
>>>>>>
>>>>>> -----Original Message-----
>>>>>> From: David Delbecq [mailto:delbd+jakarta@oma.be]
>>>>>> Sent: Friday, March 09, 2007 3:44 PM
>>>>>> To: MyFaces Discussion
>>>>>> Subject: How to set response character encoding?
>>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> i am trying to figure out how to set the response character
>>>>>>           
>>>> encoding in
>>>>      
>>>>>> my jsf pages. I am using MyFaces+Facelets, the response by default
>>>>>>           
>>>> seems
>>>>      
>>>>>> to be iso8859-1 and i'd like to set it to UTF-8, where do i
>>>>>> configure
>>>>>> this?
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>>
>>>>>>           
>>>>>
>>>>>         
>>>>       
>>
>>
>>
>>   
>


Re: How to set response character encoding?

Posted by Christopher Cudennec <Sm...@gmx.net>.
Hi, I had some issues setting the character encoding when I tried to set 
up trinidad. The problem that I ran into is described similarly here:

http://marc.theaimsgroup.com/?l=myfaces-user&m=116230903513566&w=2

So using a filter seems to be the only choice left... any other opinions?

Christopher

David Delbecq schrieb:
> Aren't filters a bit overkill for such work? Doesn't facelets have a
> simple configuration parameter for this??
> I have read mail where it's stated and fixed problem where myfaces does
> not respect the character encoding rule configured in facelets, but i
> can't find where in facelets to configure it...
>
> En l'instant précis du 14/03/07 11:24, Cagatay Civici s'exprimait en ces
> termes:
>   
>> Hi,
>>
>> A filter will help,
>>
>> http://www.jroller.com/page/mert?entry=utf_8_encoding_with_jsf
>>
>> Cagatay
>>
>> On 3/14/07, Christopher Cudennec <Sm...@gmx.net> wrote:
>>     
>>> Hi, you can use a filter. We successfully use
>>> org.springframework.web.filter.CharacterEncodingFilter in our project.
>>>
>>> Cheers, Christopher
>>>
>>> David Delbecq schrieb:
>>>       
>>>> This instruction only refers to xml charset encoding used when reading
>>>> it. Facelets does not use it as encoding for FacesContext.writer. Even
>>>> with such instruction in my xml (anyway, all my xml are already
>>>>         
>>> utf-8),
>>>       
>>>> facelets still send the response to client in iso-8859-1 charset
>>>>         
>>> encoding.
>>>       
>>>> Other suggestions?
>>>> En l'instant précis du 09/03/07 11:16, Roger Alix-Gaudreau s'exprimait
>>>> en ces termes:
>>>>
>>>>         
>>>>> I am using Facelets as well, and we define the encoding in the XML
>>>>> prolog at the top of the layout template file, as such:
>>>>>
>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>
>>>>> Roger Alix-Gaudreau
>>>>>
>>>>> -----Original Message-----
>>>>> From: David Delbecq [mailto:delbd+jakarta@oma.be]
>>>>> Sent: Friday, March 09, 2007 3:44 PM
>>>>> To: MyFaces Discussion
>>>>> Subject: How to set response character encoding?
>>>>>
>>>>> Hello,
>>>>>
>>>>> i am trying to figure out how to set the response character
>>>>>           
>>> encoding in
>>>       
>>>>> my jsf pages. I am using MyFaces+Facelets, the response by default
>>>>>           
>>> seems
>>>       
>>>>> to be iso8859-1 and i'd like to set it to UTF-8, where do i configure
>>>>> this?
>>>>>
>>>>> Thanks
>>>>>
>>>>>
>>>>>           
>>>>
>>>>         
>>>       
>
>
>
>   


Re: How to set response character encoding?

Posted by David Delbecq <de...@oma.be>.
Aren't filters a bit overkill for such work? Doesn't facelets have a
simple configuration parameter for this??
I have read mail where it's stated and fixed problem where myfaces does
not respect the character encoding rule configured in facelets, but i
can't find where in facelets to configure it...

En l'instant précis du 14/03/07 11:24, Cagatay Civici s'exprimait en ces
termes:
> Hi,
>
> A filter will help,
>
> http://www.jroller.com/page/mert?entry=utf_8_encoding_with_jsf
>
> Cagatay
>
> On 3/14/07, Christopher Cudennec <Sm...@gmx.net> wrote:
>>
>> Hi, you can use a filter. We successfully use
>> org.springframework.web.filter.CharacterEncodingFilter in our project.
>>
>> Cheers, Christopher
>>
>> David Delbecq schrieb:
>> > This instruction only refers to xml charset encoding used when reading
>> > it. Facelets does not use it as encoding for FacesContext.writer. Even
>> > with such instruction in my xml (anyway, all my xml are already
>> utf-8),
>> > facelets still send the response to client in iso-8859-1 charset
>> encoding.
>> >
>> > Other suggestions?
>> > En l'instant précis du 09/03/07 11:16, Roger Alix-Gaudreau s'exprimait
>> > en ces termes:
>> >
>> >> I am using Facelets as well, and we define the encoding in the XML
>> >> prolog at the top of the layout template file, as such:
>> >>
>> >> <?xml version="1.0" encoding="UTF-8"?>
>> >>
>> >> Roger Alix-Gaudreau
>> >>
>> >> -----Original Message-----
>> >> From: David Delbecq [mailto:delbd+jakarta@oma.be]
>> >> Sent: Friday, March 09, 2007 3:44 PM
>> >> To: MyFaces Discussion
>> >> Subject: How to set response character encoding?
>> >>
>> >> Hello,
>> >>
>> >> i am trying to figure out how to set the response character
>> encoding in
>> >> my jsf pages. I am using MyFaces+Facelets, the response by default
>> seems
>> >> to be iso8859-1 and i'd like to set it to UTF-8, where do i configure
>> >> this?
>> >>
>> >> Thanks
>> >>
>> >>
>> >
>> >
>> >
>>
>>



Re: How to set response character encoding?

Posted by Cagatay Civici <ca...@gmail.com>.
Hi,

A filter will help,

http://www.jroller.com/page/mert?entry=utf_8_encoding_with_jsf

Cagatay

On 3/14/07, Christopher Cudennec <Sm...@gmx.net> wrote:
>
> Hi, you can use a filter. We successfully use
> org.springframework.web.filter.CharacterEncodingFilter in our project.
>
> Cheers, Christopher
>
> David Delbecq schrieb:
> > This instruction only refers to xml charset encoding used when reading
> > it. Facelets does not use it as encoding for FacesContext.writer. Even
> > with such instruction in my xml (anyway, all my xml are already utf-8),
> > facelets still send the response to client in iso-8859-1 charset
> encoding.
> >
> > Other suggestions?
> > En l'instant précis du 09/03/07 11:16, Roger Alix-Gaudreau s'exprimait
> > en ces termes:
> >
> >> I am using Facelets as well, and we define the encoding in the XML
> >> prolog at the top of the layout template file, as such:
> >>
> >> <?xml version="1.0" encoding="UTF-8"?>
> >>
> >> Roger Alix-Gaudreau
> >>
> >> -----Original Message-----
> >> From: David Delbecq [mailto:delbd+jakarta@oma.be]
> >> Sent: Friday, March 09, 2007 3:44 PM
> >> To: MyFaces Discussion
> >> Subject: How to set response character encoding?
> >>
> >> Hello,
> >>
> >> i am trying to figure out how to set the response character encoding in
> >> my jsf pages. I am using MyFaces+Facelets, the response by default
> seems
> >> to be iso8859-1 and i'd like to set it to UTF-8, where do i configure
> >> this?
> >>
> >> Thanks
> >>
> >>
> >
> >
> >
>
>

Re: How to set response character encoding?

Posted by Christopher Cudennec <Sm...@gmx.net>.
Hi, you can use a filter. We successfully use 
org.springframework.web.filter.CharacterEncodingFilter in our project.

Cheers, Christopher

David Delbecq schrieb:
> This instruction only refers to xml charset encoding used when reading
> it. Facelets does not use it as encoding for FacesContext.writer. Even
> with such instruction in my xml (anyway, all my xml are already utf-8),
> facelets still send the response to client in iso-8859-1 charset encoding.
>
> Other suggestions?
> En l'instant précis du 09/03/07 11:16, Roger Alix-Gaudreau s'exprimait
> en ces termes:
>   
>> I am using Facelets as well, and we define the encoding in the XML
>> prolog at the top of the layout template file, as such:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>>
>> Roger Alix-Gaudreau
>>
>> -----Original Message-----
>> From: David Delbecq [mailto:delbd+jakarta@oma.be] 
>> Sent: Friday, March 09, 2007 3:44 PM
>> To: MyFaces Discussion
>> Subject: How to set response character encoding?
>>
>> Hello,
>>
>> i am trying to figure out how to set the response character encoding in
>> my jsf pages. I am using MyFaces+Facelets, the response by default seems
>> to be iso8859-1 and i'd like to set it to UTF-8, where do i configure
>> this?
>>
>> Thanks
>>   
>>     
>
>
>   


Re: How to set response character encoding?

Posted by David Delbecq <de...@oma.be>.
This instruction only refers to xml charset encoding used when reading
it. Facelets does not use it as encoding for FacesContext.writer. Even
with such instruction in my xml (anyway, all my xml are already utf-8),
facelets still send the response to client in iso-8859-1 charset encoding.

Other suggestions?
En l'instant précis du 09/03/07 11:16, Roger Alix-Gaudreau s'exprimait
en ces termes:
> I am using Facelets as well, and we define the encoding in the XML
> prolog at the top of the layout template file, as such:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> Roger Alix-Gaudreau
>
> -----Original Message-----
> From: David Delbecq [mailto:delbd+jakarta@oma.be] 
> Sent: Friday, March 09, 2007 3:44 PM
> To: MyFaces Discussion
> Subject: How to set response character encoding?
>
> Hello,
>
> i am trying to figure out how to set the response character encoding in
> my jsf pages. I am using MyFaces+Facelets, the response by default seems
> to be iso8859-1 and i'd like to set it to UTF-8, where do i configure
> this?
>
> Thanks
>   


RE: How to set response character encoding?

Posted by Roger Alix-Gaudreau <Rg...@manh.com>.
I am using Facelets as well, and we define the encoding in the XML
prolog at the top of the layout template file, as such:

<?xml version="1.0" encoding="UTF-8"?>

Roger Alix-Gaudreau

-----Original Message-----
From: David Delbecq [mailto:delbd+jakarta@oma.be] 
Sent: Friday, March 09, 2007 3:44 PM
To: MyFaces Discussion
Subject: How to set response character encoding?

Hello,

i am trying to figure out how to set the response character encoding in
my jsf pages. I am using MyFaces+Facelets, the response by default seems
to be iso8859-1 and i'd like to set it to UTF-8, where do i configure
this?

Thanks