I have set the charset to utf-8 using following <%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %> When I see the encoding in the "view" option of browser it shows utf-8 correctly ..but the multi lingual characters like chinese ones ..are shown as "???" in the screen. Also i m using struts 2.0 , and as per struts site I tried setting it in the form level like this : <form action="XXXXXXX" method="post" accept-charset="utf-8"> This didn't help , I tried putting a hidden parameter by name "charset" and set it to utf-8 ..as suggested in struts site as well. please provide any suggestions here .. thanks
yes , the characters are correct ..chinese font is also available. setting DBCS while creating the jsp ? I didn't understand what do you mean by that.
K.Suresh Kumar
Ranch Hand
Joined: Nov 21, 2007
Posts: 41
posted
0
Hi, Do you have Chinese font in your machine ?. Just you open a chines language based website for testing purpose. Now you see the characters like "???" then you must install chines font in your machine.
The default character encoding for many programs is ANSI (for example, most MS Windows products from Notepad to Word), not UTF-8 or Unicode.
If you save the file with the incorrect encoding, the characters will not be shown correctly when you try to use UTF-8 encoding.
I have occasionally found this to be the cause of apparent encoding issues at a later stage in the process - the file looks OK in the original editing software, but as soon as the file is read by another program, the mismatch in encoding causes problems.
So check what your character encoding is for the file you're saving to verify if this is or is not the case.
D kukreja
Ranch Hand
Joined: Jan 29, 2008
Posts: 39
posted
0
I am saving the values in the DB2 columns. The column is saved as "漢字" , and is rendered as it is on the screen. DB2 supports utf-8 already. So I need to set the encoding while posting the form ? I have used <form> tag to set the encoding , as suggested in struts site.