tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: Tomcat 6.0.14 and UTF-8 POST form problem
Date Thu, 08 Nov 2007 04:25:02 GMT
> From: Yigal Lazarev [mailto:ylazarev@gmail.com] 
> Subject: Tomcat 6.0.14 and UTF-8 POST form problem
> 
> * * Converting from ISO to UTF: *
> String subj = "קורות חיים של "+new
> String(((String)nameTextField.getValue()).
> getBytes("ISO-8859-1"), "UTF-8");

I'm confused: if the text is already in UTF-8, why are you taking an apparent text field (already
a String, perhaps?), doing a getValue() - a NOP for a String, then casting it to a String
(another NOP), converting the String to a set of Latin-1 (or Hebrew) bytes, and then lying
to a String constructor by telling it the byte array is in UTF-8?

Even if nameTextField is not a String, there's an awful lot of conflicting machinations going
on here.

Perhaps I'm missing something...

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus
for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message