| Author |
How to Set Character Encodeing in JSP
|
ramakrishna rayudu
Ranch Hand
Joined: Mar 08, 2011
Posts: 57
|
|
Hi..
i have JSP like This Can you help me how to set the character encodeing.
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile12.dtd" >
<%@taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic"%>
<%@taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean"%>
<html:html locale="true" >
<head>
<meta name="keywords" content="HTML,CSS,XML,JavaScript" />
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title><bean:message key="headertitle.text"/></title>
<link rel="stylesheet"
href="<%=request.getContextPath()%>/css/style.css"></link>
<script src="scripts/helpcontent.js"></script>
i am useing the <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
but i am unable to set the encodeing type to UTF-8
again i need to go to Browser Settings and i need to select the Encodeing Type.
is there any way that i need to set the browser character encoding to UTF_8 when the page is loding???
Example i have seen is google Home Page.when the Google Home Page Loding it will Automtically setting Browser the character Encoding tom UTF-8
Thanks,
Ramakrishna rayudu.
|
 |
sudhir nim
Ranch Hand
Joined: Aug 29, 2007
Posts: 212
|
|
You can use the contentType attribute of the page directive to set the charset for the response.
|
[Servlet tutorial] [Servlet 3.0 Cook Book]
|
 |
ramakrishna rayudu
Ranch Hand
Joined: Mar 08, 2011
Posts: 57
|
|
|
i have used the Page Directive Tag all so but no use.
|
 |
sudhir nim
Ranch Hand
Joined: Aug 29, 2007
Posts: 212
|
|
Have you tried this.
|
 |
ramakrishna rayudu
Ranch Hand
Joined: Mar 08, 2011
Posts: 57
|
|
|
yes.i have all so tried that.but i need to do the same think.i need to go to the Browser i and need to set the Character first
|
 |
sudhir nim
Ranch Hand
Joined: Aug 29, 2007
Posts: 212
|
|
|
What charset are you trying to display? I mean which language the response is in.
|
 |
ramakrishna rayudu
Ranch Hand
Joined: Mar 08, 2011
Posts: 57
|
|
|
it is wokring for all but not for Hindi
|
 |
 |
|
|
subject: How to Set Character Encodeing in JSP
|
|
|