Sunday, October 10, 2010

jsp, servlet talk about Chinese issues



In the jsp, the Chinese people to be terribly upset often garbled.

Common measures for Chinese processing, can often be seen in the main line is the following 2:

Or:

Virtual Small Dragon Pavilion is also mainly the above two kinds of methods were modified to become a 1.1 version.

A simple summary of the sample occurred in the Chinese and the following places:

1 with the Chinese in the url parameter can be directly read.

For example:

2 sql database relevant to the operation

Here the use of Access without problems.

3 to read HTML form submitted in the form of Chinese values

Need to be encoded in jswdk the more concise wording such as:

String name1 = new String (request.getParameter ("user_id"). GetBytes ("ISO8859_1"));

In addition, jdk1.3 support, do not join

In jdk1.2.2 below, even if the two kinds of methods used at the same time is also very unstable.

In the resin platform, the situation is better. As long as the first line of the page by adding:

Can correctly handle the Chinese.

If we add the code then it does not.

5 session included the Chinese

In jswdk, the strange thing is, if read from the form of encoded values can be displayed correctly;

However, given directly to Chinese values are not.

resin platform well, ibid.

6 for values of the variables assigned after the Chinese displayed correctly in Chinese.

For example, the following procedures:

Also jswdk1.0.1, above representation is not the problem in jdk1.2.2, but it can not be displayed under jdk1.3.

resin platform well, ibid, tested only in make up

Without the need to also be able to display Chinese correctly.

Experience:

jswdk may only be used for general development, stability and other issues may not be as commercial software.

As the jdk1.3 version many times better than those jdk1.2.2, and also better support for Chinese, so it should be used.

As a free commercial software, resin is not only fast, stable, and automatically compile, mistakes can be pointed out that the line can support the use of server-side javascript, etc., but at least I think that the support of the Chinese language well.

Of course, if you can not do anything with the right will show the Chinese what we expected.

Also, I believe in the unix / linux / solaris should under no such problem.







Recommended links:



Articles about Web Servers



MMOG / LE assessment of the road Troika



Feeling so steady and VB API (1)



msvcp71 dll is MISSING beware of these errors



Yuan Meng: Ubuntu 9.10 new version of the debut



Call the API function in VB dynamic change and RECOVER the screen settings



Comment Recreation



Best Graphic Editors



RMVB to MP4



Lay the foundation for the bug prevention [2]



Motorola will split into two independent companies



Shop Development



MKV To MP4



3G2 To MOV



Alibaba Ma: Even If I Have To Finally Kneeling Down



Professional confused on how To spend?



No comments:

Post a Comment