cancel
Showing results for 
Search instead for 
Did you mean: 

UTF-8 support in Web AS Java 6.40

Former Member
0 Kudos

Hi, All,

Our web application running on Web AS 6.40 with SQL Server 2000 needs to support multiple languages. We create the tables with column type NVARCHAR, set encoding scheme to UTF-8 for JDBC driver, add '<%@ page language="java" contentType="text/html;charset=UTF-8" %>' header in every JSP file and execute request.setCharacterEncoding("UTF-8") before every request is posted to the server. Everything is fine when running the same application on Tomcat with the same database & JDBC driver, enter Chinese charater in web page, store them in table, display result back... But the application deployed in Web AS Java cannot save and show Chinese character correctly.

I think I must miss some points here because UME actually supports to create user and role in Chinese...

Any help is deeply appreciated.

John

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I found what causes the problem.

I use resource bundle to handle i18n and one of bundle is myapp_zh.properties for Chinese locale. In browser I add Chinese [zh] in Language Preference then the web page should display Chinese character.

What puzzles me is that encoding of the page with Chinese characters is Chinese Simplified (GB2312) rather than UTF-8. Tomcat correctly sets page Encoding to UTF-8 since I specify <%@ page language="java" contentType="text/html;charset=UTF-8" %> in each JSP file. Why Web AS ignores this and returns Chinese character in GB2312?

Thanks a lot

John