RE: How to display chinese chars in JSP / encoding UTF-8 without @page encoding tag
Thank you for your answers. After some tests, i have upgraded my Tomcat server from 4.x to 5.5, and i have done the same thing with my web application from servlet 2.3 to servlet 2.4. Now i can use the xml element jsp-config and jsp-property-group url-pattern*.jsp/url-pattern page-encodingUTF-8/page-encoding /jsp-property-group It works fine, and i don't have to define in each jsp the encoding. For the question of which UTF has to be used : 8 or 16, i 'm using UTF-8 because the size of the page. With UTF-16, the jsp pages are twice heavier than with UTF-8. JP -Message d'origine- De : John McPeek [mailto:[EMAIL PROTECTED] Envoyé : dimanche 14 janvier 2007 20:46 À : Tomcat Users List Objet : Re: How to display chinese chars in JSP / encoding UTF-8 without @page encoding tag Why are you using UTF8 in stead on UTF16. With UTF8 you have to escape all the characters, right? I was on a project for a Japanese site once and we used UTF16. It was a lot easier to work with. Eclipse will show it to you just like normal text(Chinese). All you have to do is set the encoding to be UTF16 in the files properties. You still need the %@ page contentType=text/html; charset=UTF-16% line, but it is a lot easier to read and maintain. John From: Pulkit Singhal [mailto:[EMAIL PROTECTED] Subject: Re: How to display chinese chars in JSP / encoding UTF-8 without @page encoding tag I think you can set the -DFileEncoding flag or something to be UTF-8 in the java options of the script you use to start tomcat. It's -Dfile.encoding=UTF-8 (or UTF8; either is acceptable). - 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] ** Ce message et ses pièces jointes sont confidentiels et établis a l'intention exclusive de ses destinataires. Tout message électronique est susceptible d'altération. SOGITEC décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement. ** - 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: How to display chinese chars in JSP / encoding UTF-8 without @page encoding tag
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 John, John McPeek wrote: Why are you using UTF8 in stead on UTF16. With UTF8 you have to escape all the characters, right? UTF16 will always use 2-byte characters even when it's not necessary. For instance, all of your HTML markup will be 2-byte characters, increasing the data size by a factor of 2. Is there a compelling reason to use UTF16 instead of UTF8? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFq6Xn9CaO5/Lv0PARAq1bAJ9axlDWYF0h9DO8cdDQ4/OJuAUsWACgvuSD Ml5omji6HB7fGZC1cOsqU6Q= =q4BC -END PGP SIGNATURE- - 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: How to display chinese chars in JSP / encoding UTF-8 without @page encoding tag
I think you can set the -DFileEncoding flag or something to be UTF-8 in the java options of the script you use to start tomcat. On 1/11/07, PATTUS, Jean-Philippe [EMAIL PROTECTED] wrote: Hello the list, i'm trying to display chinese chars in my web application. I have managed to display these characters by adding this following directive in each jsp : %@ page contentType=text/html; charset=UTF-8%. It works fine. But, now i'm looking for a way to change the default charset (Iso 8859-1) used by Tomcat for the jsp compilation. I want to set this information in only one place(why not in the web.xml), to avoid to add the directive tag on my each jsp file. Let me know if you have any ideas on the subject. Regards, jp PS : When Tomcat (jasper) compiles a jsp without any directive the result is in the java source setContentType(text/html; charset=iso8859-1); When Tomcat (jasper) compiles a jsp with the directive the result is in the java source setContentType(text/html; charset=UTF-8); What i want is to have the second result without tag my jsp file with the directive %@ page contentType=text/html; charset=UTF-8% ** Ce message et ses pièces jointes sont confidentiels et établis a l'intention exclusive de ses destinataires. Tout message électronique est susceptible d'altération. SOGITEC décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement. **
RE: How to display chinese chars in JSP / encoding UTF-8 without @page encoding tag
From: Pulkit Singhal [mailto:[EMAIL PROTECTED] Subject: Re: How to display chinese chars in JSP / encoding UTF-8 without @page encoding tag I think you can set the -DFileEncoding flag or something to be UTF-8 in the java options of the script you use to start tomcat. It's -Dfile.encoding=UTF-8 (or UTF8; either is acceptable). - 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: How to display chinese chars in JSP / encoding UTF-8 without @page encoding tag
Caldarale, Charles R wrote: From: Pulkit Singhal [mailto:[EMAIL PROTECTED] Subject: Re: How to display chinese chars in JSP / encoding UTF-8 without @page encoding tag I think you can set the -DFileEncoding flag or something to be UTF-8 in the java options of the script you use to start tomcat. It's -Dfile.encoding=UTF-8 (or UTF8; either is acceptable). But, AFAICT, this will not change the charset the JSP's output is created in. Even with -Dfile.encoding=UTF-8 JSPs in standard syntax will produce an ISO-8859-1 encoded response if not explicitly told to do otherwise. One means to tell them otherwise is by using the pageEncoding attribute of the page directive - which is what the OP wanted to get rid of. Another possibility is using the page-encoding configuration element. JSPs in XML syntax will by default create an UTF-8 encoded response. Regards mks - 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: How to display chinese chars in JSP / encoding UTF-8 without @page encoding tag
Why are you using UTF8 in stead on UTF16. With UTF8 you have to escape all the characters, right? I was on a project for a Japanese site once and we used UTF16. It was a lot easier to work with. Eclipse will show it to you just like normal text(Chinese). All you have to do is set the encoding to be UTF16 in the files properties. You still need the %@ page contentType=text/html; charset=UTF-16% line, but it is a lot easier to read and maintain. John From: Pulkit Singhal [mailto:[EMAIL PROTECTED] Subject: Re: How to display chinese chars in JSP / encoding UTF-8 without @page encoding tag I think you can set the -DFileEncoding flag or something to be UTF-8 in the java options of the script you use to start tomcat. It's -Dfile.encoding=UTF-8 (or UTF8; either is acceptable). - 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: How to display chinese chars in JSP / encoding UTF-8 without @page encoding tag
PATTUS, Jean-Philippe wrote: i'm trying to display chinese chars in my web application. I have managed to display these characters by adding this following directive in each jsp : %@ page contentType=text/html; charset=UTF-8%. It works fine. But, now i'm looking for a way to change the default charset (Iso 8859-1) used by Tomcat for the jsp compilation. I want to set this information in only one place(why not in the web.xml), to avoid to add the directive tag on my each jsp file. Let me know if you have any ideas on the subject. Two ideas com to my mind: 1. Change the JSPs to use XML syntax. For those, the default encoding is UTF-8. 2. Add something like jsp-config jsp-property-group url-pattern*.jsp/url-pattern page-encodingUTF-8/page-encoding /jsp-property-group /jsp-config to the web.xml of your application. The snippet above is written from memory. So it may not be correct but should give you the idea what to look for. Regards mks - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]