You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Nicola Benaglia <ni...@idra-spa.it> on 2006/03/23 15:14:15 UTC

post method & encoding UTF-8

Hi !!!
I have a lot of troubles with encoding UTF-8 and in particular when I 
post some data by forms.
When I write the post received data in a page I cannot see the right 
characters.
For example:

Name: èèè (three "e" with an accent)
Surname: èèè

I get the following output: èèè

The same proble when I use cyrillic alphabet.
I want to precise that every page has the following header:

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Pragma-directive" content="no-cache">
	<meta http-equiv="Cache-directive" content="no-cache">
</head>
...

Could you please give me a tip ?

Thank you in advance,
nicola



---

Questa mail ed eventuali suoi allegati sono strettamente confidenziali. Se
ricevete per errore questa mail, Vi preghiamo cortesemente di cancellarla
immediatamente e di segnalare l'errore a chi ve l'ha spedita. Se Voi non siete
il reale destinatario di questa mail non siete autorizzati alla copia, alla
distribuzione e alla stampa di essa ne tantomeno ad una eventuale modifica
dei contenuti.
 
This message and any attachments are confidential and intended solely for
the addressees. If you receive this message in error, please delete it and
immediately notify the sender. If the reader of this message is not the
intended recipient, you are hereby notified that any unauthorized use,
copying, publication, printing or dissemination is prohibited. E-mails are
susceptible to alteration.

Re: post method & encoding UTF-8

Posted by Alexander Panzhin <ja...@balticum-tv.lt>.
Well if you're not stupid you'll put the filter over JSF servlet ONLY.
> I suggest using a phaseListener instead of a filter. if you use a 
> filter it will mess up the css files( effects mozilla) the sample 
> phaseListener is in the facelets wiki
> On 3/23/06, * Alexander Panzhin* <jalexoid@balticum-tv.lt 
> <ma...@balticum-tv.lt>> wrote:
>
>     If you're using Facelets the only way is making a filter and
>     adding two
>     silmple lines:
>             request.setCharacterEncoding(encoding);
>             response.setCharacterEncoding(encoding);
>     Where encoding is the String "UTF-8".
>     > Hi !!!
>     > I have a lot of troubles with encoding UTF-8 and in particular
>     when I
>     > post some data by forms.
>     > When I write the post received data in a page I cannot see the right
>     > characters.
>     > For example:
>     >
>     > Name: ่่่ (three "e" with an accent)
>     > Surname: ่่่
>     >
>     > I get the following output: รจรจรจ
>     >
>     > The same proble when I use cyrillic alphabet.
>     > I want to precise that every page has the following header:
>     >
>     > <html>
>     > <head>
>     >     <meta http-equiv="Content-Type" content="text/html;
>     charset=UTF-8">
>     >     <meta http-equiv="Pragma-directive" content="no-cache">
>     >     <meta http-equiv="Cache-directive" content="no-cache">
>     > </head>
>     > ...
>     >
>     > Could you please give me a tip ?
>     >
>     > Thank you in advance,
>     > nicola
>     >
>     >
>     >
>     > ---
>     >
>     > Questa mail ed eventuali suoi allegati sono strettamente
>     > confidenziali. Se
>     > ricevete per errore questa mail, Vi preghiamo cortesemente di
>     cancellarla
>     > immediatamente e di segnalare l'errore a chi ve l'ha spedita. Se Voi
>     > non siete
>     > il reale destinatario di questa mail non siete autorizzati alla
>     copia,
>     > alla
>     > distribuzione e alla stampa di essa ne tantomeno ad una eventuale
>     > modifica
>     > dei contenuti.
>     >
>     > This message and any attachments are confidential and intended
>     solely for
>     > the addressees. If you receive this message in error, please
>     delete it
>     > and
>     > immediately notify the sender. If the reader of this message is
>     not the
>     > intended recipient, you are hereby notified that any
>     unauthorized use,
>     > copying, publication, printing or dissemination is prohibited.
>     E-mails
>     > are
>     > susceptible to alteration.
>     >
>
>
>     --
>        Su pagarba,
>           Aleksandr Panzin
>           IT sistemu architektas.
>
>        With best regards,
>           Alexander Panzhin
>           IT systems architect
>
>
>
>
>
>
> -- 
> from debian manifesto:
> Debian Linux is a brand-new kind of Linux distribution.
> Rather than being developed by one isolated individua
> l or group, as other distributions of Linux have been developed in the
> past, Debian is being developed openly in the spirit of Linux and GNU. 


-- 
   Su pagarba,
      Aleksandr Panzin
      IT sistemu architektas.

   With best regards,
      Alexander Panzhin
      IT systems architect 


Re: post method & encoding UTF-8

Posted by Arash Bijanzadeh <ar...@gmail.com>.
I suggest using a phaseListener instead of a filter. if you use a filter it
will mess up the css files( effects mozilla) the sample phaseListener is in
the facelets wiki
On 3/23/06, Alexander Panzhin <ja...@balticum-tv.lt> wrote:
>
> If you're using Facelets the only way is making a filter and adding two
> silmple lines:
>         request.setCharacterEncoding(encoding);
>         response.setCharacterEncoding(encoding);
> Where encoding is the String "UTF-8".
> > Hi !!!
> > I have a lot of troubles with encoding UTF-8 and in particular when I
> > post some data by forms.
> > When I write the post received data in a page I cannot see the right
> > characters.
> > For example:
> >
> > Name: ่่่ (three "e" with an accent)
> > Surname: ่่่
> >
> > I get the following output: รจรจรจ
> >
> > The same proble when I use cyrillic alphabet.
> > I want to precise that every page has the following header:
> >
> > <html>
> > <head>
> >     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
> >     <meta http-equiv="Pragma-directive" content="no-cache">
> >     <meta http-equiv="Cache-directive" content="no-cache">
> > </head>
> > ...
> >
> > Could you please give me a tip ?
> >
> > Thank you in advance,
> > nicola
> >
> >
> >
> > ---
> >
> > Questa mail ed eventuali suoi allegati sono strettamente
> > confidenziali. Se
> > ricevete per errore questa mail, Vi preghiamo cortesemente di
> cancellarla
> > immediatamente e di segnalare l'errore a chi ve l'ha spedita. Se Voi
> > non siete
> > il reale destinatario di questa mail non siete autorizzati alla copia,
> > alla
> > distribuzione e alla stampa di essa ne tantomeno ad una eventuale
> > modifica
> > dei contenuti.
> >
> > This message and any attachments are confidential and intended solely
> for
> > the addressees. If you receive this message in error, please delete it
> > and
> > immediately notify the sender. If the reader of this message is not the
> > intended recipient, you are hereby notified that any unauthorized use,
> > copying, publication, printing or dissemination is prohibited. E-mails
> > are
> > susceptible to alteration.
> >
>
>
> --
>    Su pagarba,
>       Aleksandr Panzin
>       IT sistemu architektas.
>
>    With best regards,
>       Alexander Panzhin
>       IT systems architect
>
>
>
>


--
from debian manifesto:
Debian Linux is a brand-new kind of Linux distribution.
Rather than being developed by one isolated individua
l or group, as other distributions of Linux have been developed in the
past, Debian is being developed openly in the spirit of Linux and GNU.

Re: post method & encoding UTF-8

Posted by Alexander Panzhin <ja...@balticum-tv.lt>.
If you're using Facelets the only way is making a filter and adding two 
silmple lines:
        request.setCharacterEncoding(encoding);
        response.setCharacterEncoding(encoding);
Where encoding is the String "UTF-8".
> Hi !!!
> I have a lot of troubles with encoding UTF-8 and in particular when I 
> post some data by forms.
> When I write the post received data in a page I cannot see the right 
> characters.
> For example:
>
> Name: èèè (three "e" with an accent)
> Surname: èèè
>
> I get the following output: èèè
>
> The same proble when I use cyrillic alphabet.
> I want to precise that every page has the following header:
>
> <html>
> <head>
>     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
>     <meta http-equiv="Pragma-directive" content="no-cache">
>     <meta http-equiv="Cache-directive" content="no-cache">
> </head>
> ...
>
> Could you please give me a tip ?
>
> Thank you in advance,
> nicola
>
>
>
> ---
>
> Questa mail ed eventuali suoi allegati sono strettamente 
> confidenziali. Se
> ricevete per errore questa mail, Vi preghiamo cortesemente di cancellarla
> immediatamente e di segnalare l'errore a chi ve l'ha spedita. Se Voi 
> non siete
> il reale destinatario di questa mail non siete autorizzati alla copia, 
> alla
> distribuzione e alla stampa di essa ne tantomeno ad una eventuale 
> modifica
> dei contenuti.
>
> This message and any attachments are confidential and intended solely for
> the addressees. If you receive this message in error, please delete it 
> and
> immediately notify the sender. If the reader of this message is not the
> intended recipient, you are hereby notified that any unauthorized use,
> copying, publication, printing or dissemination is prohibited. E-mails 
> are
> susceptible to alteration.
>


-- 
   Su pagarba,
      Aleksandr Panzin
      IT sistemu architektas.

   With best regards,
      Alexander Panzhin
      IT systems architect 


Re: post method & encoding UTF-8

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

Had a similiar problem once and solved it with a filter approach as Mario
already suggested.

Cagatay Civici,

On 3/23/06, Mario Ivankovits <ma...@ops.co.at> wrote:
>
> Hi Nicola!
> > Name: èèè (three "e" with an accent)
> > Surname: èèè
> >
> > I get the following output: èèè
> You have to create a servletFilter.
> See: http://wiki.apache.org/tomcat/Tomcat/UTF-8
> *See "Alternative solution" which uses the filter - dont waste your time
> with the toUTF8() stuff.
>
> Ciao,
> Mario
>
> *
>
>
>

Re: post method & encoding UTF-8

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi Nicola!
> Name: èèè (three "e" with an accent)
> Surname: èèè
>
> I get the following output: èèè
You have to create a servletFilter.
See: http://wiki.apache.org/tomcat/Tomcat/UTF-8
*See "Alternative solution" which uses the filter - dont waste your time
with the toUTF8() stuff.

Ciao,
Mario

*

Re: post method & encoding UTF-8

Posted by Grigoras Cristinel <gr...@wdd.ro>.
Hi Nicola,

     If you what to save using some encoding specify for your form
encoding="*multipart*/*form*-*data*" and
the page encoding:

<%@ page language="java" contentType="text/html;
charset=UTF-8;"  pageEncoding="UTF-8" %>

.
I don't know why this is happen. Maybe is a bug.

Cristi


Nicola Benaglia wrote:
> Hi !!!
> I have a lot of troubles with encoding UTF-8 and in particular when I
> post some data by forms.
> When I write the post received data in a page I cannot see the right
> characters.
> For example:
>
> Name: èèè (three "e" with an accent)
> Surname: èèè
>
> I get the following output: èèè
>
> The same proble when I use cyrillic alphabet.
> I want to precise that every page has the following header:
>
> <html>
> <head>
>     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
>     <meta http-equiv="Pragma-directive" content="no-cache">
>     <meta http-equiv="Cache-directive" content="no-cache">
> </head>
> ...
>
> Could you please give me a tip ?
>
> Thank you in advance,
> nicola
>
>
>
> ---
>
> Questa mail ed eventuali suoi allegati sono strettamente
> confidenziali. Se
> ricevete per errore questa mail, Vi preghiamo cortesemente di cancellarla
> immediatamente e di segnalare l'errore a chi ve l'ha spedita. Se Voi
> non siete
> il reale destinatario di questa mail non siete autorizzati alla copia,
> alla
> distribuzione e alla stampa di essa ne tantomeno ad una eventuale
> modifica
> dei contenuti.
>
> This message and any attachments are confidential and intended solely for
> the addressees. If you receive this message in error, please delete it
> and
> immediately notify the sender. If the reader of this message is not the
> intended recipient, you are hereby notified that any unauthorized use,
> copying, publication, printing or dissemination is prohibited. E-mails
> are
> susceptible to alteration.
>


RE: post method & encoding UTF-8

Posted by Yu...@muranosoft.com.
Hi, Nicola

You can try to use on your jsf page:

<%@ page language="java" session="true" contentType="text/html;
charset=UTF-8;"  pageEncoding="UTF-8" %>

Thanks,
Yura.


-----Original Message-----
From: Nicola Benaglia [mailto:nicola.benaglia@idra-spa.it] 
Sent: Thursday, March 23, 2006 4:14 PM
To: MyFaces Discussion
Subject: post method & encoding UTF-8

Hi !!!
I have a lot of troubles with encoding UTF-8 and in particular when I 
post some data by forms.
When I write the post received data in a page I cannot see the right 
characters.
For example:

Name: èèè (three "e" with an accent)
Surname: èèè

I get the following output: èèè

The same proble when I use cyrillic alphabet.
I want to precise that every page has the following header:

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Pragma-directive" content="no-cache">
	<meta http-equiv="Cache-directive" content="no-cache">
</head>
...

Could you please give me a tip ?

Thank you in advance,
nicola



---

Questa mail ed eventuali suoi allegati sono strettamente confidenziali. Se
ricevete per errore questa mail, Vi preghiamo cortesemente di cancellarla
immediatamente e di segnalare l'errore a chi ve l'ha spedita. Se Voi non
siete
il reale destinatario di questa mail non siete autorizzati alla copia, alla
distribuzione e alla stampa di essa ne tantomeno ad una eventuale modifica
dei contenuti.
 
This message and any attachments are confidential and intended solely for
the addressees. If you receive this message in error, please delete it and
immediately notify the sender. If the reader of this message is not the
intended recipient, you are hereby notified that any unauthorized use,
copying, publication, printing or dissemination is prohibited. E-mails are
susceptible to alteration.