dcsimg
Japanese Language in JSP / Oracle Queries or Java
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Akira_Yamashita
Posted On:   Thursday, September 5, 2002 08:30 AM

I have several JSP pages that I am using to read and write Japanese characters. I am using JRUN 3.1 and soon 4 for the container for JSP/Struts. The problem I am having is when I input Japanese into a form and a bean picks it up, or read it from a query from Oracle 8i, when I go to redisplay it, it comes back garbled. I then select Encoding->Japanese (Auto-Detect) in Windows IE5.1 and the display changs to view Japanese correctly. The real issue is that it detects and displays the Japanese correctly and the encoding it picks is Japanese Shift-JIS so when I try and force the web page through a JSP tag like this <%@ page contentType="text/html; charset=Shift_JIS"%> or any other encoding in there it does not forma   More>>

I have several JSP pages that I am using to read and write Japanese characters. I am using JRUN 3.1 and soon 4 for the container for JSP/Struts. The problem I am having is when I input Japanese into a form and a bean picks it up, or read it from a query from Oracle 8i, when I go to redisplay it, it comes back garbled. I then select Encoding->Japanese (Auto-Detect) in Windows IE5.1 and the display changs to view Japanese correctly. The real issue is that it detects and displays the Japanese correctly and the encoding it picks is Japanese Shift-JIS so when I try and force the web page through a JSP tag like this

			
<%@ page contentType="text/html; charset=Shift_JIS"%>

or any other encoding in there it does not format correctly and it is still garbage. I have tried several methods similar to this such as META tags and using Ken Lundes method of auto-detecting in HTML to no degree of success. The auto-detect in IE does pick it up correct so I know the data must be in correct format somwhere. I am writing into Oracle using UTF8 and it does come out correctly when I auto-detect. It is only a problem when I try to force the encoding to what it auto-detects.





Since I am using Struts and the pages have to expire upon any changes (as dictated by our design) then the user can never auto-detect the language through the menu selection. Doing so expires page and the page refreshes using defaults. This is going to be a problem since I have to force encoding in on the user in this case. Doing so is garbage.



I know my English is unclear and I am running along, but I am trying to make myself clear. Anyone with experience with this subject and can help I would appreciate. I am going crazy a little trying everything I can think of.

   <<Less
About | Sitemap | Contact