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
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.
There will always be people who are ahead of the curve, and people who are behind the curve. But knowledge moves the curve. --Bill James
posted 10 years ago
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.