Re: Tomcat 6.0.14 and UTF-8 POST form problem
Yigal Lazarev wrote: Hi, I'm deploying a JSF WAR onto Tomcat 6.0.14 under Windows 2003 with JVM version 1.6.0_03-b05, and using MySQL db. When I submit a form using POST method, and in the server side take the fields and send them as an email using JavaMail- i lose the UTF-8 encoded characters sent in the form. I suspect it's something with the Tomcat configuration because it does not happen when I deploy to Sun Application Server 8.2 And another thing, UTF-8 characters hardcoded in the sending email method are sent just fine. Shalom Yigal, all your efforts are useless. Just do the following thing and you'll be happy: open up the server.xml search for the Connector node which works for HTTP and add the attribute URIEncoding=UTF-8 restart tomcat and go on using: String string = request.getParamter(name); that's it. Works perfectly here. Some reference for you: http://confluence.atlassian.com/display/DOC/Configuring+Tomcat's+URI+encoding Lehitraot, Michael -- NO OOXML - Say NO To Microsoft Office broken standard http://www.noooxml.org - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 6.0.14 and UTF-8 POST form problem
Yigal Lazarev wrote: Shalom Michael, Thanks for your reply, but as you can see in my first post, this was the second thing I tried.. Inserting URIEncoding=UTF-8 to the HTTP and the AJP/1.3 connectors in server.xml didn't help. More suggestions? did you tell the JVM to use UTF-8 as file encoding? -Dfile.enconding=UTF-8 -- NO OOXML - Say NO To Microsoft Office broken standard http://www.noooxml.org - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 6.0.14 and UTF-8 POST form problem
Well Michael you've just solved the problem! Thank you very much ! :) On Nov 8, 2007 12:46 PM, Michael [EMAIL PROTECTED] wrote: Michael wrote: Yigal Lazarev wrote: Shalom Michael, Thanks for your reply, but as you can see in my first post, this was the second thing I tried.. Inserting URIEncoding=UTF-8 to the HTTP and the AJP/1.3 connectors in server.xml didn't help. More suggestions? did you tell the JVM to use UTF-8 as file encoding? -Dfile.enconding=UTF-8 -Dfile.encoding=UTF-8 -- NO OOXML - Say NO To Microsoft Office broken standard http://www.noooxml.org - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 6.0.14 and UTF-8 POST form problem
Yigal Lazarev wrote: Well Michael you've just solved the problem! Thank you very much ! :) You are welcome! Try to avoid top posting in future: http://en.wikipedia.org/wiki/Posting_style Which barely impossible to read Cheers to israel, Mike -- NO OOXML - Say NO To Microsoft Office broken standard http://www.noooxml.org - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 6.0.14 and UTF-8 POST form problem
Michael wrote: Yigal Lazarev wrote: Shalom Michael, Thanks for your reply, but as you can see in my first post, this was the second thing I tried.. Inserting URIEncoding=UTF-8 to the HTTP and the AJP/1.3 connectors in server.xml didn't help. More suggestions? did you tell the JVM to use UTF-8 as file encoding? -Dfile.enconding=UTF-8 -Dfile.encoding=UTF-8 -- NO OOXML - Say NO To Microsoft Office broken standard http://www.noooxml.org - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 6.0.14 and UTF-8 POST form problem
Shalom Michael, Thanks for your reply, but as you can see in my first post, this was the second thing I tried.. Inserting URIEncoding=UTF-8 to the HTTP and the AJP/1.3 connectors in server.xml didn't help. More suggestions? On Nov 8, 2007 11:28 AM, Michael [EMAIL PROTECTED] wrote: Yigal Lazarev wrote: Hi, I'm deploying a JSF WAR onto Tomcat 6.0.14 under Windows 2003 with JVM version 1.6.0_03-b05, and using MySQL db. When I submit a form using POST method, and in the server side take the fields and send them as an email using JavaMail- i lose the UTF-8 encoded characters sent in the form. I suspect it's something with the Tomcat configuration because it does not happen when I deploy to Sun Application Server 8.2 And another thing, UTF-8 characters hardcoded in the sending email method are sent just fine. Shalom Yigal, all your efforts are useless. Just do the following thing and you'll be happy: open up the server.xml search for the Connector node which works for HTTP and add the attribute URIEncoding=UTF-8 restart tomcat and go on using: String string = request.getParamter(name); that's it. Works perfectly here. Some reference for you: http://confluence.atlassian.com/display/DOC/Configuring+Tomcat's+URI+encodinghttp://confluence.atlassian.com/display/DOC/Configuring+Tomcat%27s+URI+encoding Lehitraot, Michael -- NO OOXML - Say NO To Microsoft Office broken standard http://www.noooxml.org - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 6.0.14 and UTF-8 POST form problem
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]
RE: Tomcat 6.0.14 and UTF-8 POST form problem
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]