You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Sun Yiyi <yy...@ONLINE.EMICH.EDU> on 2000/03/01 22:54:59 UTC

JSP cannot work, Bug of NT(MS) or bug of JDK(SUN)?

Hi, All,

In my JSPs, I used strings in which the characters' ascii value are > 127
(high
bit=1). This happens when I create pages in Chinese.

Under English version of WinNT, JSP pages which have Chinese characters
runs well.

But under Chinese version of WinNT, Tomcat 3.0 cannot do it. It seems that
the engine cannot translate the Chinese strings to unicode. So JSP won't
run.

How to solve this problem? Please advise..

yysun


Re: JSP cannot work, Bug of NT(MS) or bug of JDK(SUN)?

Posted by Vyacheslav Pedak <vp...@geocities.com>.
----- Original Message -----
From: Sun Yiyi <yy...@ONLINE.EMICH.EDU>
To: <to...@jakarta.apache.org>
Sent: Thursday, March 02, 2000 6:50 AM
Subject: Re: JSP cannot work, Bug of NT(MS) or bug of JDK(SUN)?


> Hi, Mandar,
>
> Thanks for your reply.
>
> I have used <%@ page contentType="text/html;charset=gb2312" %>, it doesn't
> work.
>
> For my JSP statement <% out.print("<h1>отй╬жпнд</h1><br>"); %>,
>
> the servlet code generated by Tomcat under English NT is:
>
>
>
out.print("<h1>\u00cf\u00d4\u00ca\u00be\u00d6\u00d0\u00ce\u00c4</h1><br>");
> (It works!)
>
>
> And here is code generated by Tomcat under Chinese NT:
>
>     out.print("<h1>>:-\u0087</h1><br>");
>                              -----
>                              ^^^
>
> Why it has this >: ?   (So angry?)
>

I have the same problem with russian language
and I can solve it by encoding all chars in JSP file by unicode
(&#<unicode>;)
This is not the best method, but I can not find another.

Vyacheslav Pedak.


Re: JSP cannot work, Bug of NT(MS) or bug of JDK(SUN)?

Posted by MANDAR RAJE <ma...@pathfinder.eng.sun.com>.
I will look into it. Thanks for pointing it out.

Mandar.

Sun Yiyi wrote:
> 
> Hi, Mandar,
> 
> Thanks for your reply.
> 
> I have used <%@ page contentType="text/html;charset=gb2312" %>, it doesn't
> work.
> 
> For my JSP statement <% out.print("<h1>ÏÔʾÖÐÎÄ</h1><br>"); %>,
> 
> the servlet code generated by Tomcat under English NT is:
> 
> out.print("<h1>\u00cf\u00d4\u00ca\u00be\u00d6\u00d0\u00ce\u00c4</h1><br>");
> (It works!)
> 
> And here is code generated by Tomcat under Chinese NT:
> 
>     out.print("<h1>>:-\u0087</h1><br>");
>                              -----
>                              ^^^
> 
> Why it has this >: ?   (So angry?)
> 
> I found these under  [path to tomcat]work\8080 folder.
> 
> ps. When I try <%@ page contentType="text/html;charset=iso-2022-jsp" %>, it
> displays a message: "Unsuported encoding: iso-2022-jsp" in the console
> window.
> 
> yysun
> 
> > Hi Sun,
> >
> >  Are you using the page directive to set the contentType
> > in your JSP?
> >
> >  Just try adding the following line:
> >
> > <%@ page contentType="text/html;charset=ENCODING" %>
> >
> >  Replace ENCODING with the character encoding you are
> > using. (For examples, for Japanese pages you would
> > use "iso-2022-jsp").
> >
> >  Let me know if this works.
> >
> > Thanks,
> > Mandar.
> >
> > Sun Yiyi wrote:
> > >
> > > Hi, All,
> > >
> > > In my JSPs, I used strings in which the characters' ascii value are >
> 127
> > > (high
> > > bit=1). This happens when I create pages in Chinese.
> > >
> > > Under English version of WinNT, JSP pages which have Chinese characters
> > > runs well.
> > >
> > > But under Chinese version of WinNT, Tomcat 3.0 cannot do it. It seems
> that
> > > the engine cannot translate the Chinese strings to unicode. So JSP won't
> > > run.
> > >
> > > How to solve this problem? Please advise..
> > >
> > > yysun
> > >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org

Re: JSP cannot work, Bug of NT(MS) or bug of JDK(SUN)?

Posted by Sun Yiyi <yy...@ONLINE.EMICH.EDU>.
Hi, Mandar,

Thanks for your reply.

I have used <%@ page contentType="text/html;charset=gb2312" %>, it doesn't
work.

For my JSP statement <% out.print("<h1>ÏÔʾÖÐÎÄ</h1><br>"); %>,

the servlet code generated by Tomcat under English NT is:


out.print("<h1>\u00cf\u00d4\u00ca\u00be\u00d6\u00d0\u00ce\u00c4</h1><br>");
(It works!)


And here is code generated by Tomcat under Chinese NT:

    out.print("<h1>>:-\u0087</h1><br>");
                             -----
                             ^^^

Why it has this >: ?   (So angry?)

I found these under  [path to tomcat]work\8080 folder.

ps. When I try <%@ page contentType="text/html;charset=iso-2022-jsp" %>, it
displays a message: "Unsuported encoding: iso-2022-jsp" in the console
window.

yysun


> Hi Sun,
>
>  Are you using the page directive to set the contentType
> in your JSP?
>
>  Just try adding the following line:
>
> <%@ page contentType="text/html;charset=ENCODING" %>
>
>  Replace ENCODING with the character encoding you are
> using. (For examples, for Japanese pages you would
> use "iso-2022-jsp").
>
>  Let me know if this works.
>
> Thanks,
> Mandar.
>
> Sun Yiyi wrote:
> >
> > Hi, All,
> >
> > In my JSPs, I used strings in which the characters' ascii value are >
127
> > (high
> > bit=1). This happens when I create pages in Chinese.
> >
> > Under English version of WinNT, JSP pages which have Chinese characters
> > runs well.
> >
> > But under Chinese version of WinNT, Tomcat 3.0 cannot do it. It seems
that
> > the engine cannot translate the Chinese strings to unicode. So JSP won't
> > run.
> >
> > How to solve this problem? Please advise..
> >
> > yysun
> >



Re: JSP cannot work, Bug of NT(MS) or bug of JDK(SUN)?

Posted by MANDAR RAJE <ma...@pathfinder.eng.sun.com>.
Hi Sun,

 Are you using the page directive to set the contentType
in your JSP?

 Just try adding the following line:

<%@ page contentType="text/html;charset=ENCODING" %>

 Replace ENCODING with the character encoding you are
using. (For examples, for Japanese pages you would 
use "iso-2022-jsp").

 Let me know if this works.

Thanks,
Mandar.

Sun Yiyi wrote:
> 
> Hi, All,
> 
> In my JSPs, I used strings in which the characters' ascii value are > 127
> (high
> bit=1). This happens when I create pages in Chinese.
> 
> Under English version of WinNT, JSP pages which have Chinese characters
> runs well.
> 
> But under Chinese version of WinNT, Tomcat 3.0 cannot do it. It seems that
> the engine cannot translate the Chinese strings to unicode. So JSP won't
> run.
> 
> How to solve this problem? Please advise..
> 
> yysun
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org