javascript - why java code not converting text to utf8 characters? -
javascript - why java code not converting text to utf8 characters? -
my jsp page has encoding follows :
<%@ page contenttype="text/html; charset=utf-8" pageencoding="utf-8" %> <% response.setheader("cache-control", "no-cache"); response.setheader("pragma", "no-cache"); response.setdateheader("expires", 0); response.setcharacterencoding("utf-8"); response.setcontenttype("text/html;charset=utf-8"); %>
javascript code printing greek characters in firebug next code :
function save() { console.log(document.editdistributionlistform.elements['name'].value); //this line prints greek characters document.editdistributionlistform.elements['subaction'].value='submit'; document.editdistributionlistform.submit(); }
when 'name' value above sent struts action, string not printing greek characters instead prints ????????????????
greek characters entered : αβγδεζηθ
struts bean (sample code) :
public void setname(string name) { this.name = name; } public string getname() { homecoming name; }
struts action (sample code) :
protected actionforward updatelist(actionmapping mapping, httpservletrequest request, editlistform form) throws cannotoverwriteexistinglistexception, emptylistexception, listupdateexception { log.debug("form.getname :: "+form.getname()); //this line when printed prints (???) }
when info sent html java i.e. browser server string gets converted greek ???? doing wrong. not able identify missing .. .
please help.
there no greek characters in utf-8.
i think should reprogram programme create print utf-16 characters (which include greek characters). (change page encoding utf-8 utf-16)
java javascript jsp utf-8 struts-1.x
Comments
Post a Comment