I�m really sorry for sending so big email to the mailing list for
already fixed problem.
I want to say at the beginning that after aplying SP1 all my servlets
are working perfectly.
Actually I put a lot of effort to find a solution. So response object
is printing all special chars correctly using code set as it is in the
source bellow. The problem appears when I want to read data using
request.getParameter(); I tried to read the parameters using different
encoding sets especially Cp1254 but unfortunately without success. The
strange thing is that getQueryString() is working fine. If I put some
special chars in the URL I read them in the response correctly. I�ll
repeat this text again around the source lines.
// JRun 3.0 developer edition
// iPlanet FF 4.1 for HTTP listener
// Process the HTTP Get request
public void doGet
(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html; charset=windows-1254");
PrintWriter out = new PrintWriter (response.getOutputStream());
out.println("<html>");
out.println("<head><title>Encoding</title></head>");
out.println("<body>");
out.println("<form action=\""+request.getRequestURI()+
"\" method=\"GET\">");
out.println("<input type=\"Text\" name=\"SomeText\" value=\"\">");
out.println("<input type=\"Submit\" value=\"Send\"
name=\"send\">");
out.println("</form><pre>");
// Return null at the moment
out.println("getCharacterEncoding:\t" +
request.getCharacterEncoding() );
// In case I type strange chars directly in the URL on my browser
// they are printed corectly with the code bellow
out.println("getQueryString:\t\t" + request.getQueryString() );
// Before SP1 this print destroy part of the special chars
// I discover that it's actually kept only these from Cp1252
out.println("SomeText:\t\t"+request.getParameter("SomeText") );
// I did also the conversion recommended by Mr. Clement Wong by
// using Cp1254 CharSet because my SQL Server database
// is encoded with it. This appears to be my mistake as well
// because even after SP1 it is not working
String SomeText=new String(
request.getParameter("SomeText").getBytes("Cp1254") );
out.println("SomeText2:\t\t"+SomeText);
out.println("</pre></body></html>");
out.close();
}
--- Scott Stirling <[EMAIL PROTECTED]> wrote:
> Usually these problems are due to not setting the contentType
> correctly in a
> page directive (in JSP) or using the setContentType() method on the
> HttpServletResponse object. If you are doing that and it's not
> working, it's a
> bug. But I believe this works, so please provide a simple test case
> I can
> reproduce it with if you want to claim it as a bug in JRun.
>
> Scott Stirling
>
> > -----Original Message-----
> > From: Dobromir Karamelsky [mailto:[EMAIL PROTECTED]]
> > Sent: Sunday, October 08, 2000 2:13 AM
> > To: JRun-Talk
> > Subject: Turkish characters problem
> >
> >
> > Hi,
> >
> > With JRun 3.0 I want to receive in a servlet some text containing
> > Turkish chars. With POST and GET method I�m getting the same
> result:
> > smashing most of the special chars to �?�,
> > I�m using:
> >
> > String SomeText = request.getParameter("SomeText");
> >
> > I�m also reading such a text from a database and everything is
> fine. I
> > can write Turkish chars correctly to the output. If I try to get
> > requested URL and it contain Turkish chars I can read them
> correctly as
> > well.
> >
> > My last test was to run the same servlet into iPlanet Fast Track
> and
> > everything was fine. I was able to get all Turkish chars from one
> POST
> > (or GET) request and to save them into db field, which was the
> primary
> > goal.
> >
> > So does anyone know a possible solution?
>
>
>
------------------------------------------------------------------------------
> Archives: http://www.egroups.com/group/jrun-interest/
> Unsubscribe:
>
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
> or send a message to [EMAIL PROTECTED] with
> 'unsubscribe' in the body.
__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/
------------------------------------------------------------------------------
Archives: http://www.egroups.com/group/jrun-interest/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the
body.