----------------------------------------------------------------
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!!!
----------------------------------------------------------------

[EMAIL PROTECTED] wrote:
> javax.servlet.ServletRequest.getCharacterEncoding()
> returns
> request.getCharacterEncoding() =ISO-8859-1
> How can i change it to get some characters which are losing?

You cannot change it. Its value for GET requests should be ISO-8859-1
as there is no way how to specify encoding for GET requests in the HTTP
header.
Its value for POST requests depends on the "charset" attribute of
"Content-type"
header, but current browsers don't set the attribute, so you will always
get ISO-8859-1. 

But current browsers use encoding of the page with the FORM tag, so do
this:

String good = 
 new
String(req.getParameter("mypar").getBytes("ISO-8859-1"),"ISO-8859-9");

for getting correct value of a parameter from a page with ISO-8859-9
encoding.

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/32
--------------------------------------------------------------------


--
--------------------------------------------------------------
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