AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to put traditional Chinese text into Unicode Oracle 9i d

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases
View previous topic :: View next topic  
Author Message
bjwang@acs.com.tw
Guest





PostPosted: Thu Dec 23, 2004 5:16 am    Post subject: How to put traditional Chinese text into Unicode Oracle 9i d Reply with quote



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-Cool 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





PostPosted: Thu Dec 23, 2004 2:17 pm    Post subject: Re: How to put traditional Chinese text into Unicode Oracle Reply with quote



[email]bjwang (AT) acs (DOT) com.tw[/email] wrote:
Quote:
Hello wisers,


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
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.