java - apache tomcat and glassfish server not decoding utf-8 characters? -
this jsp page:
<!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>jsp page</title> </head> <body> <% string msg="206_john_help m in trouble,delhi,อินเดีย_30.64741430_76.817313799"; string result = java.net.urlencoder.encode(msg, "utf-8"); system.out.println("the msg "+result); string result1=java.net.urldecoder.decode(result, "utf-8"); system.out.println("the decoded msg "+result1); %> </body> </html>
the output 206_john_help m in trouble,delhi,???????_30.64741430_76.817313799
i getting ?????? instead of thai alphabets. how can thai alphabets while decoding?
you can try adding @ top:
<%@page language="java" contenttype="text/html; charset=utf-8" pageencoding="utf-8"%>
i think solve problem. if not, give more information?
are using eclipse? if yes, developing under windows? in windows, eclipse default works windows cp1252 codification jsp , other files. text written can cp1252 charset.
where running tomcat , glashfish? windows? linux?
Comments
Post a Comment