You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dan Tran <da...@hotmail.com> on 2002/12/31 00:08:15 UTC

Re: Problem with € and multipart/form-data enctype

I just changed one of my utf8 txt file to contain a  €  and
display back to the browser.   It works

Did you use the recommended filter in

http://www.anassina.com/struts/i18n/i18n.html ?

-Dan

----- Original Message -----
From: "Christophe Vigouroux" <ch...@ecilia.fr>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Monday, December 30, 2002 2:40 AM
Subject: RE : Problem with € and multipart/form-data enctype


Thanks for your reply; it helped me to go further on...

Now, I know where the problem is: it's nothing with Hibernate or Postgres.
In fact with the multipart form encoding, the characters are encoded with
Unicode (or UTF-8?). For example my € symbol is represented by the 8364
code. With the default form encoding, it was represented by the 0128 code.

My problem now is to render correctly the € symbol when it is coded by
8364... I tried to put the <%@ page contentType="text/html; charset=UTF-8"
%> directive, but it renders "€" instead of "€"... Is there another way to
render the "€" symbol another way than using the html entity &#8364; ?
Because I have the following problem: when my ActionForm is not validated,
it returns to the input page automatically and struts populate the form
fields. So when one of my fields contains the € symbol, it isn't rendered
well... and I can't replace it with the &#8364; entity, am I right?

Any help would be appreciated!


Christophe VIGOUROUX
ECILIA - Ingénieur développement
Tel: 04.78.68.46.14
Fax: 04.37.43.69.01


-----Message d'origine-----
De : Dan Tran [mailto:danttran@hotmail.com]
Envoyé : vendredi 27 décembre 2002 18:31
À : Struts Users Mailing List
Objet : Re: Problem with € and multipart/form-data enctype

Have you try to set your jsp's content type to charset=utf-8??

The following references may help:

   - Struts upload example
   - http://www.anassina.com/struts/i18n/i18n.html

-D
----- Original Message -----
From: "Christophe Vigouroux" <ch...@ecilia.fr>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Friday, December 27, 2002 8:11 AM
Subject: Problem with Ђ and multipart/form-data enctype


Hi,

I'm developing an application using struts and hibernate for data
persistence. I have some kind of problems with special characters like the
"€" one.
When I use a standard <html:form> (so using the default
application/x-www-form-urlencoded enctype), I have no problem : the €
character is well persisted and I can load and display correctly the data
from my database (postgresql with Unicode database).

But when it comes to use multipart/form-data enctype in order to send some
file along with some text, the € character seems not to be saved correctly
in the database (it doesn't display well at all after reloading the data).
I've tried to modify a working form (from application/x-www-form-urlencoded
to multipart/form-data enctype) and the € symbol is not well saved.

I'm quite confused because when I try to debug my application, the attribute
of my form bean containing the € symbol is right (it outputs in my logger as
a € symbol...). Whatever enctype is used the character seems to be right in
the form bean, but with multipart enctype it does not save right in the
database!! Anyone as an idea of what I'm experiencing ??

Christophe Vigouroux



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE : Problem with € and multipart/form-data enctype

Posted by Christophe Vigouroux <ch...@ecilia.fr>.
Yes I also tried this filter, and it doesn't work...

The origin of the problem comes from the fact that I input a € in a field and then whereas I store it in a database or it is displayed back to my input page in case of an error (so automatically done by struts) it is not rendered properly (I tried latin-1 and utf-8 encoding for my jsp).

Christophe VIGOUROUX
ECILIA - Ingénieur développement
Tel: 04.78.68.46.14
Fax: 04.37.43.69.01


-----Message d'origine-----
De : Dan Tran [mailto:danttran@hotmail.com] 
Envoyé : mardi 31 décembre 2002 00:08
À : Struts Users Mailing List
Objet : Re: Problem with € and multipart/form-data enctype

I just changed one of my utf8 txt file to contain a  €  and
display back to the browser.   It works

Did you use the recommended filter in

http://www.anassina.com/struts/i18n/i18n.html ?

-Dan

----- Original Message -----
From: "Christophe Vigouroux" <ch...@ecilia.fr>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Monday, December 30, 2002 2:40 AM
Subject: RE : Problem with € and multipart/form-data enctype


Thanks for your reply; it helped me to go further on...

Now, I know where the problem is: it's nothing with Hibernate or Postgres.
In fact with the multipart form encoding, the characters are encoded with
Unicode (or UTF-8?). For example my € symbol is represented by the 8364
code. With the default form encoding, it was represented by the 0128 code.

My problem now is to render correctly the € symbol when it is coded by
8364... I tried to put the <%@ page contentType="text/html; charset=UTF-8"
%> directive, but it renders "€" instead of "€"... Is there another way to
render the "€" symbol another way than using the html entity &#8364; ?
Because I have the following problem: when my ActionForm is not validated,
it returns to the input page automatically and struts populate the form
fields. So when one of my fields contains the € symbol, it isn't rendered
well... and I can't replace it with the &#8364; entity, am I right?

Any help would be appreciated!


Christophe VIGOUROUX
ECILIA - Ingénieur développement
Tel: 04.78.68.46.14
Fax: 04.37.43.69.01


-----Message d'origine-----
De : Dan Tran [mailto:danttran@hotmail.com]
Envoyé : vendredi 27 décembre 2002 18:31
À : Struts Users Mailing List
Objet : Re: Problem with € and multipart/form-data enctype

Have you try to set your jsp's content type to charset=utf-8??

The following references may help:

   - Struts upload example
   - http://www.anassina.com/struts/i18n/i18n.html

-D
----- Original Message -----
From: "Christophe Vigouroux" <ch...@ecilia.fr>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Friday, December 27, 2002 8:11 AM
Subject: Problem with Ђ and multipart/form-data enctype


Hi,

I'm developing an application using struts and hibernate for data
persistence. I have some kind of problems with special characters like the
"€" one.
When I use a standard <html:form> (so using the default
application/x-www-form-urlencoded enctype), I have no problem : the €
character is well persisted and I can load and display correctly the data
from my database (postgresql with Unicode database).

But when it comes to use multipart/form-data enctype in order to send some
file along with some text, the € character seems not to be saved correctly
in the database (it doesn't display well at all after reloading the data).
I've tried to modify a working form (from application/x-www-form-urlencoded
to multipart/form-data enctype) and the € symbol is not well saved.

I'm quite confused because when I try to debug my application, the attribute
of my form bean containing the € symbol is right (it outputs in my logger as
a € symbol...). Whatever enctype is used the character seems to be right in
the form bean, but with multipart enctype it does not save right in the
database!! Anyone as an idea of what I'm experiencing ??

Christophe Vigouroux



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>