Re: How do I handle International Characters
Hi Lutz As far as HTML forms are concerned, you can force the browser to submit them to the server using a particular charset by adding the accept-charset attribute to the form tag, i.e.: form accept-charset=utf-8 ... ... /form http://www.w3.org/TR/REC-html40/interact/forms.html#adef-accept-charset Thanks for that tip! Setting the 'http-equiv' meta-tag seems to suffice, but I'm all for a belt and braces approach. Kind regards Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I handle International Characters
Lutz Zetzsche wrote: Hi Harry, Am Montag, 9. Mai 2005 20:53 schrieb Harry Mantheakis: Browsers should (and mostly do, I think) respect the encoding you specify when setting the response content-type (and the meta-tag content-type) so you can simply assume (in your filter) that your form-data will be in UTF-8. Clients still need to, of course, set their browsers to display the relevant charsets correctly. As far as HTML forms are concerned, you can force the browser to submit them to the server using a particular charset by adding the accept-charset attribute to the form tag, i.e.: form accept-charset=utf-8 ... ... /form http://www.w3.org/TR/REC-html40/interact/forms.html#adef-accept-charset This does however not work with Internet Explorer. I had this problem in the past. IE insists on using the page charset and ignores the accept-charset attribute. There were some more information at this URL (http://ppewww.ph.gla.ac.uk/~flavell/charset/form-i18n.html), but it is currently not available. HTH Christoph - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How do I handle International Characters
A method we have used with success for inbound request encoding is to add a Servlet Filter to our application whose sole job is to call request.setCharacterEncoding(UTF-8) Allistair. -Original Message- From: Christoph Kutzinski [mailto:[EMAIL PROTECTED] Sent: 10 May 2005 08:54 To: Tomcat Users List Subject: Re: How do I handle International Characters Lutz Zetzsche wrote: Hi Harry, Am Montag, 9. Mai 2005 20:53 schrieb Harry Mantheakis: Browsers should (and mostly do, I think) respect the encoding you specify when setting the response content-type (and the meta-tag content-type) so you can simply assume (in your filter) that your form-data will be in UTF-8. Clients still need to, of course, set their browsers to display the relevant charsets correctly. As far as HTML forms are concerned, you can force the browser to submit them to the server using a particular charset by adding the accept-charset attribute to the form tag, i.e.: form accept-charset=utf-8 ... ... /form http://www.w3.org/TR/REC-html40/interact/forms.html#adef-acce pt-charset This does however not work with Internet Explorer. I had this problem in the past. IE insists on using the page charset and ignores the accept-charset attribute. There were some more information at this URL (http://ppewww.ph.gla.ac.uk/~flavell/charset/form-i18n.html), but it is currently not available. HTH Christoph - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I handle International Characters
A method we have used with success for inbound request encoding is to add a Servlet Filter to our application whose sole job is to call request.setCharacterEncoding(UTF-8) Allistair. And you might consider adding a call to: response.setContentType( text/html; charset=UTF-8 ); In the same filter. It can be reset if a servlet (or JSP) needs to do something different, like downloading files. Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I handle International Characters
Hello I am using Tomcat 5.0 and I am trying to receive and send thai characters. Can someone please tell me the simplest ways to do this. This worked for me with Japanese characters: Use a filter to set encodings for both requests and responses: request.setCharacterEncoding( UTF-8 ); response.setContentType( text/html; charset=UTF-8 ); Specify the following HTML header meta-tag in your JSPs: meta http-equiv=Content-Type content=text/html; charset=UTF-8 Always specify UTF-8 as the charset. Stick to submitting form-data with POST methods. I have not tried encoding URI's with GET requests. If you must use URI's with GET requests, try to limit yourself to working with ID-string parameters, so that you can avoid encoding issues. NOTE: Calling the 'ServletResponse.setContentType()' method (as above) is equivalent to calling the following two ServletResponse methods together: response.setContentType( text/html ); response.setCharacterEncoding( UTF-8 ); Browsers should (and mostly do, I think) respect the encoding you specify when setting the response content-type (and the meta-tag content-type) so you can simply assume (in your filter) that your form-data will be in UTF-8. Clients still need to, of course, set their browsers to display the relevant charsets correctly. HTH. Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I handle International Characters
I am using the following plug-in for properties file. http://propedit.sourceforge.jp/index_en.html Helps when using messages resources , eliminate the need of native2ascii.exe Regards Haim Harry Mantheakis wrote: Hello I am using Tomcat 5.0 and I am trying to receive and send thai characters. Can someone please tell me the simplest ways to do this. This worked for me with Japanese characters: Use a filter to set encodings for both requests and responses: request.setCharacterEncoding( UTF-8 ); response.setContentType( text/html; charset=UTF-8 ); Specify the following HTML header meta-tag in your JSPs: meta http-equiv=Content-Type content=text/html; charset=UTF-8 Always specify UTF-8 as the charset. Stick to submitting form-data with POST methods. I have not tried encoding URI's with GET requests. If you must use URI's with GET requests, try to limit yourself to working with ID-string parameters, so that you can avoid encoding issues. NOTE: Calling the 'ServletResponse.setContentType()' method (as above) is equivalent to calling the following two ServletResponse methods together: response.setContentType( text/html ); response.setCharacterEncoding( UTF-8 ); Browsers should (and mostly do, I think) respect the encoding you specify when setting the response content-type (and the meta-tag content-type) so you can simply assume (in your filter) that your form-data will be in UTF-8. Clients still need to, of course, set their browsers to display the relevant charsets correctly. HTH. Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I handle International Characters
Hi Harry, Am Montag, 9. Mai 2005 20:53 schrieb Harry Mantheakis: Browsers should (and mostly do, I think) respect the encoding you specify when setting the response content-type (and the meta-tag content-type) so you can simply assume (in your filter) that your form-data will be in UTF-8. Clients still need to, of course, set their browsers to display the relevant charsets correctly. As far as HTML forms are concerned, you can force the browser to submit them to the server using a particular charset by adding the accept-charset attribute to the form tag, i.e.: form accept-charset=utf-8 ... ... /form http://www.w3.org/TR/REC-html40/interact/forms.html#adef-accept-charset Best wishes, Lutz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How do I handle International Characters
I am using Tomcat 5.0 and I am trying to receive and send thai characters. Can someone please tell me the simplest ways to do this. Many thanks Dave. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I handle International Characters
http://jakarta.apache.org/tomcat/faq/misc.html#tomcat5CharEncoding Mark David Harland wrote: I am using Tomcat 5.0 and I am trying to receive and send thai characters. Can someone please tell me the simplest ways to do this. Many thanks Dave. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I handle International Characters
Hi Mark If I have tried the following. response.setContentType(text/html; charset=utf-8); PrintWriter out = response.getWriter(); request.setCharacterEncoding(UTF-8); String test=request.getParameter(login); out.println(Input string:+test); out.println(URLEncoder.encode(test,UTF-8)); out.close(); What is output to the browser is Unicode instead of the characters. If I look at the source of the returned page. I see #3615;#3627;#3585;#3615;#3627;#3585; instead of characters like #3585;#3619;#3640;#3591;#3648;#3607;#3614;#3631;. Regards David. --- Mark Thomas [EMAIL PROTECTED] wrote: http://jakarta.apache.org/tomcat/faq/misc.html#tomcat5CharEncoding Mark David Harland wrote: I am using Tomcat 5.0 and I am trying to receive and send thai characters. Can someone please tell me the simplest ways to do this. Many thanks Dave. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I handle International Characters
David, You also need to look at how the parameters are set in the first place. Are you using GET or POST? If you are using GET have you set any of the character encoding settings on the connector? The following index.jsp works for me: %@ page contentType=text/html; charset=UTF-8 % !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head titleCharacter encoding test page/title /head body pData posted to this form was: % request.setCharacterEncoding(UTF-8); out.print(request.getParameter(mydata)); % /p form method=post action=index.jsp input type=text name=mydata input type=submit value=Submit / input type=reset value=Reset / /form /body /html David Harland wrote: Hi Mark If I have tried the following. response.setContentType(text/html; charset=utf-8); PrintWriter out = response.getWriter(); request.setCharacterEncoding(UTF-8); String test=request.getParameter(login); out.println(Input string:+test); out.println(URLEncoder.encode(test,UTF-8)); out.close(); What is output to the browser is Unicode instead of the characters. If I look at the source of the returned page. I see #3615;#3627;#3585;#3615;#3627;#3585; instead of characters like #3585;#3619;#3640;#3591;#3648;#3607;#3614;#3631;. Regards David. --- Mark Thomas [EMAIL PROTECTED] wrote: http://jakarta.apache.org/tomcat/faq/misc.html#tomcat5CharEncoding Mark David Harland wrote: I am using Tomcat 5.0 and I am trying to receive and send thai characters. Can someone please tell me the simplest ways to do this. Many thanks Dave. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I handle International Characters
#3655;Hi Mark, Many thanks for your help. Dave. --- Mark Thomas [EMAIL PROTECTED] wrote: David, You also need to look at how the parameters are set in the first place. Are you using GET or POST? If you are using GET have you set any of the character encoding settings on the connector? The following index.jsp works for me: %@ page contentType=text/html; charset=UTF-8 % !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head titleCharacter encoding test page/title /head body pData posted to this form was: % request.setCharacterEncoding(UTF-8); out.print(request.getParameter(mydata)); % /p form method=post action=index.jsp input type=text name=mydata input type=submit value=Submit / input type=reset value=Reset / /form /body /html David Harland wrote: Hi Mark If I have tried the following. response.setContentType(text/html; charset=utf-8); PrintWriter out = response.getWriter(); request.setCharacterEncoding(UTF-8); String test=request.getParameter(login); out.println(Input string:+test); out.println(URLEncoder.encode(test,UTF-8)); out.close(); What is output to the browser is Unicode instead of the characters. If I look at the source of the returned page. I see #3615;#3627;#3585;#3615;#3627;#3585; instead of characters like #3585;#3619;#3640;#3591;#3648;#3607;#3614;#3631;. Regards David. --- Mark Thomas [EMAIL PROTECTED] wrote: http://jakarta.apache.org/tomcat/faq/misc.html#tomcat5CharEncoding Mark David Harland wrote: I am using Tomcat 5.0 and I am trying to receive and send thai characters. Can someone please tell me the simplest ways to do this. Many thanks Dave. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]