While "contentType" is very important, I think that the attribute that you want is "pageEncoding". In a JSP/1.2 container like Tomcat 4.1.12 this tells Tomcat what the charset of the physical jsp file itself is. Since you say that you are using Unicode, try: <%@page pageEncoding="UTF-8" %>
"Mike W-M" <[EMAIL PROTECTED]> wrote in message 026201c2a1e0$c54d9f20$[EMAIL PROTECTED]">news:026201c2a1e0$c54d9f20$[EMAIL PROTECTED]... > That's clearer. > My email client isn't showing the chinese characters, actually. I'm sure > both that fact and your problem are related to character-encoding...(though > I don't exactly know what to do about it). > > JSPs have a "contentType" attribute. (I think it defaults to iso-8851 > (equivalent to windows-1252?) or whatever it is if not specified - and I'm > pretty sure that won't support Chinese.) > I'm not sure whether that affects the parsing, but I'd hope so. > All my pages start with > <%@ page contentType="text/html;charset=windows-1252" %>. > You might want to look into that attribute (in the JSP specs) to see whether > it's supposed to affect parsing or is just used to indicate something to the > client. Otherwise, I'd bet that one of Tomcat's or Jasper's encoding types > doesn't match with something that it ought to. > > Mike. > > > ----- Original Message ----- > From: "Partha Ranjan Das" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, December 12, 2002 11:22 AM > Subject: RE: problem with chinese output in jsp/tomcat 4.1.12 > > > Hi Mike, > Thanks for your observation. > The main problem is : > whenever i try to use some chinese content in the jsp whether in the body or > in the java code, the jsp tags are not being parsed by the jsp engine with > tomcat4.1.12. > And hence, in the html output, I am finding that the <%...%> tags are left > as they are. This is not happening for english content. > Don't bother about the fact that the ??? maks are not showing as chinese if > your email client can show chinese. > For example, > <BODY> > <form name=frm1 action="page2.jsp" method=POST> > <Select name=sel1> > <option value=1>??????</option> > <option value=2>????</option> > </select><br> > <input type=submit value=submit> > </form> > </BODY> > I hope it shows the chinese. > Any idea what the problem can be (I feel the problem could be with tomcat, > but am not sure)? > Regards, > partha > > > -----Original Message----- > > From: Laxmikanth M.S. > > Sent: Thursday, December 12, 2002 4:38 PM > > To: Partha Ranjan Das > > Subject: FW: problem with chinese output in jsp/tomcat 4.1.12 > > > > I don't quite see where the chinese characters come into it, but I think > > you've forgotten to put the curly-brackets > > round the thing that's supposed to be conditional. > > Instead of.... > > <%if(request.getParameter("sel1").equals("1"))%> > > ?????? > > <%out.println("hi from partha");%> > > > > ...I suggest you try... > > <% if(request.getParameter("sel1").equals("1")) { %> > > Hi from partha > > <% } %> > > > > However, I think this in itself is a little flawed because you're going to > > get a null-reference error if you try the equals comparison if no "sel1" > > was > > supplied. > > > > Hope that helps. > > Mike. > > > > > > > > ----- Original Message ----- > > From: "Partha Ranjan Das" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Thursday, December 12, 2002 5:46 AM > > Subject: problem with chinese output in jsp/tomcat 4.1.12 > > > > > > > Hi, > > > I am using Tomcat 4.1.12. My requirement is to get Chinese > > > characters in JSP > > > pages. > > > I am using the following code: > > > > > > in one page which has the form I am using: > > > <BODY> > > > <form name=frm1 action="page2.jsp" method=POST> > > > <Select name=sel1> > > > <option value=1>??????</option> > > > <option value=2>????</option> > > > </select><br> > > > <input type=submit value=submit> > > > </form> > > > </BODY> > > > > > > > > > in the next page (page2.jsp) i am using the following code: > > > <%@ page contentType = "text/html; charset=big5"%> > > > <BODY> > > > this is a chinese output: > > > <br> > > > <%if(request.getParameter("sel1").equals("1"))%> > > > ?????? > > > <%out.println("hi from partha");%> > > > </BODY> > > > > > > The problem is that in any case i am getting the output as > > > the chinese chars > > > that have been written into the jsp body of page2.jsp irrespective of > > > whether i choose the first or the second option. and in the > > > html output is > > > also similar to the jsp code, which means that the jsp > > > translation is not > > > taking place in the tomcat. For other english pages it is happening > > > perfectly alright. > > > Any idea what can be done so that the translation takes place and the > > > conditional display of chinese is possible. Also shall be > > > highly grateful if > > > you give idea as to how to initialize and manipulate chinese strings. > > > > > > > > > Thanks in advance, > > > Regards, > > > Partha > > > > > > ps- those ? marks are the chinese characters. I am using > > > Unicode text option > > > while saving the jsp files. So character conversion to ASCII > > > while saving is > > > ruled out. In fact the IE output is giving chinese. > > ********************************************************************* > > Disclaimer: The information in this e-mail and any attachments is > > confidential / privileged. It is intended solely for the addressee or > > addressees. If you are not the addressee indicated in this message, you > > may > > not copy or deliver this message to anyone. In such case, you should > > destroy > > this message and kindly notify the sender by reply email. Please advise > > immediately if you or your employer does not consent to Internet email for > > messages of this kind. > > ********************************************************************* > > > > -- > > To unsubscribe, e-mail: > > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > > <mailto:[EMAIL PROTECTED]> > > > > > > > > > > -- > > To unsubscribe, e-mail: > > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > > <mailto:[EMAIL PROTECTED]> > ********************************************************************* > Disclaimer: The information in this e-mail and any attachments is > confidential / privileged. It is intended solely for the addressee or > addressees. If you are not the addressee indicated in this message, you may > not copy or deliver this message to anyone. In such case, you should destroy > this message and kindly notify the sender by reply email. Please advise > immediately if you or your employer does not consent to Internet email for > messages of this kind. > ********************************************************************* > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>