Thanks for the reply Chuck, I read in the documentation that the default encoding in Tomcat for incoming requests like from a form submission is Latin-1 (ISO-8859-1). So the text in nameTextField (which is of type TextField) is UTF-8 text that was 'treated' like Latin-1. What I did is as suggested here: http://www.jguru.com/faq/view.jsp?EID=1030399 to take the value (getValue() which returns an Object) and cast into String, then take the bytes as Latin-1 and construct a new String to return it to UTF-8. Please correct me if I'm wrong.
I've changed the code a bit and it looks like this: String nameText = (String)nameTextField.getText(); String convText = new String(ntft.getBytes("ISO-8859-1"), "UTF-8"); String subj = "קורות חיים של "+convText; message.setSubject(subj, "utf-8"); getText() returns an Object so it has to be casted to String. Still doesn't work. Any suggestions are welcome.. On Nov 8, 2007 6:25 AM, Caldarale, Charles R < [EMAIL PROTECTED]> wrote: > > From: Yigal Lazarev [mailto: [EMAIL PROTECTED] > > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >