I'm using windows2000 server(Chinese version) and JDK1.3(standard edition).My JSP engine is JRun3.0.
In stand alone java applications,I can use system.out to print chinese character to console without trouble;
In servlet, after adding "response.setContentType("text/html charset=GBK")",the output is OK.
But in JSP,I've done everything and the output is still ???? or unrecognizable charecters.Below is the scriptlet:
<%
String cs="";
String sss= "目录";
byte ba[]=sss.getBytes();
try{
cs= new String(ba,"GBK" );
}catch (Exception ee){
System.out.println("exception");}
out.println(cs);
PrintWriter pw = new PrintWriter(out);
pw.println(cs);
%>
In stand alone java applications,I can use system.out to print chinese character to console without trouble;
In servlet, after adding "response.setContentType("text/html charset=GBK")",the output is OK.
But in JSP,I've done everything and the output is still ???? or unrecognizable charecters.Below is the scriptlet:
<%
String cs="";
String sss= "目录";
byte ba[]=sss.getBytes();
try{
cs= new String(ba,"GBK" );
}catch (Exception ee){
System.out.println("exception");}
out.println(cs);
PrintWriter pw = new PrintWriter(out);
pw.println(cs);
%>