----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

Aleksander Grzebyta wrote:
> The problem is that the parameter names and values retrieved in doPost
> method by
> 
> req.getParameterNames
> req.getParameter( name )
> 
> do not depend on the charset I use ( Central Europe's: "iso-8859-2" or
> "windows-1250". They are always in "iso-8859-1" charset so I cannot see my
> polish special characters. There is everything OK when I perform the
> following conversion:
> 
> String parValue;
> //...
> parValue = new String( req.getParameter( parName ).getBytes( "iso-8859-1" ),
> "iso-8859-2" );
> 
> Can anybody provide me with some further explanation of that issue ? Maybe I
> should specify in  my HTML form so that the server know the charset I use ?

The problem is that today's browsers don't set the  "charset" attribute
for POST requests. So the information about encoding is lost. The only
solution is the one you have already discovered - make reverse translation
using ISO-8859-1 and then apply the correct translation (which you have to guess).

This situation will change with Mozzila 5.0, which will set the "charset"
attribute. 

Martin
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   INET, a.s.                          Mgr. Martin Kuba
Kralovopolska 139                  e-mail: [EMAIL PROTECTED]
  601 12 Brno                      WWW: http://www.inet.cz/~makub/
 Czech Republic                    tel: +420-5-41242414/33
--------------------------------------------------------------------
PGP fingerprint = D8 57 47 E5 36 D2 C1 A1  C3 48 B2 59 00 58 42 27
 http://wwwkeys.cz.pgp.net:11371/pks/lookup?op=index&search=makub
--------------------------------------------------------------------


--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to