Sorry, I know decompile the JSWDK code is illegal. I just want to say what I found and
how do I solve problem of handling non-ASCII JSP page in JSWDK
 
Damn the JSP engine of JSWDK donesnt support Chinese.
but I guess the JSP engine written with javacc. So, I cant understand why it cant support Chinese(Big5 encoding)
Then I decompile the com.sun.jsp.compiler.EscapeUnicodeWriter class file
I found these stupid code, and I comment it out
=============================================
    public void write(char ac[], int i, int j)
        throws IOException
    {
        if(out == null)
            throw new IOException("Stream closed");
       
        out.write((new String(ac, i, j)).getBytes());
       
        /*
        while(--j >= 0)
        {
            int k = ac[i++] & 0xff;
            if((k < 32 || k > 126) && k != 10 && k != 13 && k != 9)
            {
                bytes[0] = 92;
                bytes[1] = 117;
                bytes[2] = (byte)Character.forDigit((k & 0xf000) >> 12, 16);
                bytes[3] = (byte)Character.forDigit((k & 0xf00) >> 8, 16);
                bytes[4] = (byte)Character.forDigit((k & 0xf0) >> 4, 16);
                bytes[5] = (byte)Character.forDigit(k & 0xf, 16);
                out.write(bytes);
            }
            else
            {
                out.write((byte)k);
            }
        }
        */
 
    }
=================================================
I dont know why the JSP engine author want to do ASCII hibyte quoting.
the javac can handle it. It's not necessary to do this.
why they did this stupid code, I really cant understand.
 
I hope the JSP 1.0 release can fix this bug.
 
so now I cant do this I my page
 
¤¤¤å//this is Big5 (Taiwan's chinese character encoding)code, so you may not see it
<%
response.setContentType("text/html; charset=Big5")
// you must do this, since the "contentType" attribute of page directive not function
%>
 
this chinese code appear
I think this can also work on other double byte encoding. hope this useful
-Brenden- @_@

Reply via email to