 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
bjwang@acs.com.tw Guest
|
Posted: Thu Dec 23, 2004 5:16 am Post subject: How to put traditional Chinese text into Unicode Oracle 9i d |
|
|
Hello wisers,
We are testing a system which is developed on top of Oracle 9iAS. The
client PCs are using Internet Explorer to access the system. We are
sure that the Oracle 9i database server is set to use Unicode. The
Oracle 9i database server and Oracle 9iAS server are now running on
English Windows 2000 server. With client PCs running on traditional
Chinese Windows 2000 or traditional Chinese Windows XP, via Internet
Explorer we put traditional Chinese text into the system then query the
data again, it displays in inverted question marks.
1. How to resolve the problem?
2. Does the Internet Explorer View -> Code Unicode (UTF- setting
controls content display as well as keyin?
3. Or the system controls the code interpretation of keyin?
Thanks,
Bruce
|
|
| Back to top |
|
 |
Sergey Bezrukov Guest
|
Posted: Thu Dec 23, 2004 2:17 pm Post subject: Re: How to put traditional Chinese text into Unicode Oracle |
|
|
[email]bjwang (AT) acs (DOT) com.tw[/email] wrote:
I think in your web-app you should use Filter, which will calls
request.setCharacterEncoding("WhatDoYouWant") because overwise,
according to spec, server should set request encoding to iso-8859-1.
There is an example:
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class CharsetFilter implements Filter
{
// charset
private String encoding;
public void init(FilterConfig config) throws ServletException
{
// read from config
encoding = config.getInitParameter("requestEncoding");
// default
if( encoding==null ) encoding="UTF8";
}
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain next)
throws IOException, ServletException
{
request.setCharacterEncoding(encoding);
next.doFilter(request, response);
}
public void destroy(){}
}
And configuration:
<!-- CharsetFilter -->
<filter>
<filter-name>Charset Filter</filter-name>
<filter-class>CharsetFilter</filter-class>
<init-param>
<param-name>requestEncoding</param-name>
<param-value>UTF8</param-value>
</init-param>
</filter>
<!-- CharsetFilter mapping -->
<filter-mapping>
<filter-name>Charset Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Hope this helps.
--
WBR,
Serge.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|