Globalize your On Demand Business
来源:互联网 发布:linux chown 子目录 编辑:程序博客网 时间:2024/05/01 22:47
Globalize your On Demand Business
Supporting GB18030 In Web Applications : Retrieve and Display dataWe use a JSP file GB18030.jsp to retrieve the GB18030 data in DB2 database via JDBC. In GB18030.jsp, we do not call the methods such as response.setLocale() and response.setContentType(). And then the parameter “charset” in GB18030.jsp determines the value of response.getCharacterEncoding().
We assume the GB18030 data in two kinds of format. One is in Unicode format (UTF-8 or UCS-2). The other is in HTML character references format such as &#xxxxx.
Retrieve and Display GB18030 data in Unicode format
There are two results when retrieving GB18030 data:
Figure 6 When the data is retrieved correctly.
Figure 7 When the data is retrieved NOT correctly.
And here is the summary table according to the different charset parameters in GB18030.jsp:
charset parameter in GB18030.jsp
Result
charset=GB18030
Success (Figure 6)
charset=GB2312
Fail (Figure 7)
charset=ISO-8859-1
Fail (Figure 7)
charset=UTF-8
Success (Figure 6)
Retrieve and Display GB18030 data in character references format
Because the HTML character references format such as 㐁 is an encoding-independent character, every View > Encoding can parse the data correctly:
Charset parameter in GB18030.jsp
Result
Charset=GB18030
Success (Figure 6)
Charset=GB2312
Success (Figure 6)
Charset=ISO-8859-1
Success (Figure 6)
Charset=UTF-8
Success (Figure 6)
IE and Netscape’s behavior of displaying GB18030 data in kinds of objects
In GB18030.jsp file, we define HTML objects of Text Area, Text Field, List Box and Drop Down Menu. We retrieve the GB18030 data into these objects. However, we find that IE 6.0 has the weakness to display GB18030 data in some objects, while Netscape 7.0 behaves well.
The weakness of IE 6.0 is that it displays GB18030 data in square in some objects as following though the IE’s font is already set to GB18030 font. The symptom is the same for the IE on Windows XP.
Here is a summary table about this behavior:
HTML objects
IE 6.0
Netscape 7.0
Text Area
OK
OK
OK
Display as Square
OK
List Box
Display as Square
OK
Drop Down Menu
Display as Square
OK
Amendment:Explicitly set the font “SimSun-18030” to be used by the objects: in the HTML file, add “ STYLE="font-family:'SimSun-18030' ” as each object’s attribute, and then, GB18030 data display correctly.
IE and Netscape’s behavior of displaying surrogate data
With GB18030.jsp file, we can see that the surrogate data can display correctly in the above four objects both in Netscape 7.0 and IE 6.0, for example,
- Globalize your On Demand Business
- Pass4Sure IBM On Demand Business
- Oracle E-Business Suite On Demand
- Windows Vista On Demand
- game on demand
- 视频点播 video on demand
- Loading Views On Demand
- On-Demand Resources Essentials
- initialization on demand holder
- On Demand Resources
- Office Word 2007 On Demand
- Grid Computing (On Demand Series)
- Oracle CRM On Demand Reporting
- 1. On-demand Contact CenterServices
- Grails翻译 - Load On-Demand
- Demand paging on Nand Flash
- On-demand initializer for NSDateFormatter
- Manipulating Broadcast Receivers On Demand
- C/C++面试题
- XML WebService完全实例详细解析
- 字符串中特定单词逆序
- Wscript.Shell对象详细介绍
- java中用递归方法求第n个Fibonacci数
- Globalize your On Demand Business
- Java IDE之争 谁是下一个霸主
- 算式计算
- New Chinese Encoding GB-18030
- SAP 模块中文解释
- 应届毕业生少走弯路的十条忠告(转)
- ASP的数据库指针操作
- 配置CGI运行时间
- Java基于GPL协议开源有助Linux发展