Hi frineds,
I have code fragment(
JSP) as below, my aim is convert Unicode characters into UTF-8. Parameter "save" contains Unicode characters(Vietnamese characters) got from editor box on browser. These characters stored in
String variable called save. Output of variable save(SAVE 1) is not correct that mean is not Vietnamese characters. So I convert them into UTF-8 in try/catch block. As a result of output(SAVE 2), they show Vietnamese characters correctly but my data outputed is missed many characters.
What are anything wrong? Please have a hints.
Thanks in advandce.
String save = request.getParameter("save");
System.out.println("SAVE 1 = "+save);
if (save != null) {
try {
save = new String(save.getBytes(),"UTF-8");
System.out.println("SAVE 2 = "+save);
} catch (UnsupportedEncodingException e) {
}
Vietjav.