1
votes

Up to this moment, I still have no luck to resolve this Chinese characters issue. I am using OC4J 9.0.4.1 with Oracle 10g Database (that is created with UTF-8). The situation is that my JSP page is set with pageencoding = UTF-8 already.

I save some Chinese characters from web page to database (varchar2 column) via Thin Driver. In iSQLPlus, those Chinese characters cannot be shown. Then the content is retrieved by using ResultSet.getString. When the content is placed back to JSP Page, it shwos monster characters.

Anyone can help ?

The background information of the settings: NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CHARACTERSET AL32UTF8
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 10.2.0.1.0
System.getProperty("file_encoding") = MS950

Anyone can help ?

1

1 Answers

1
votes

I save some Chinese characters from web page to database (varchar2 column) via Thin Driver. In iSQLPlus, those Chinese characters cannot be shown

You need to set the request body encoding to the same encoding as the pageEncoding of the JSP before obtaining the parameters.

request.setCharacterEncoding("UTF-8");

Note that the above applies on POST requests only (I expect you're using POST here), for GET request parameters you need to configure it in the servletcontainer level.

See also: