js| Solutions | problems | Chinese in JSP, Chinese garbled often make people confused.
For the common countermeasures of Chinese processing, the following 2 kinds are often visible on the Internet:
In JSWDK, it is strange that if the value read from form is encoded, it can be displayed correctly;
But it is not possible to give Chinese values directly.
Resin platform is very good, ditto.
6 correctly displays Chinese after assigning Chinese values to variables.
For example, the following programs:
<%@ page contenttype= "text/html;charset=gb2312"
%>
<%
String
hi= "Hello";
Byte[] Tmpbyte=hi.getbytes ("iso8859_1");
Hi=new
String (Tmpbyte);
Out.print (Hi);
%>
</body>
The same is jswdk1.0.1, the above method of representation in the jdk1.2.2 no problem, but under the jdk1.3 can not be displayed.
Resin platform is very good, ditto, after testing, only need to fill in the
<meta
http-equiv= "Content-type" content= "text/html;
charset=gb2312 ">
Without the need to <%@ page
Contenttype= "text/html;charset=gb2312"%> can also display Chinese correctly.
Experience:
JSWDK may only be used for general development, and stability and other problems may not be as good as commercial software.
Because the jdk1.3 version performance is better than jdk1.2.2 many times, and the Chinese support is also good, so should be adopted.
As a free commercial software, resin not only fast, stable, automatic compilation, can point to error line, can support the use of JavaScript on the server side, and, at least, I think the support for Chinese is very good.
Of course, if you do not have to do any processing to correctly display the Chinese will be what we expect.
In addition, I believe that under the unix/linux/solaris should not have such a problem.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.