Using Malayalam in JSTL

Hi,

I have been trying to use malayalam using jstl.

Here is my code

i have a properties file called home_ml_IN.properties

which contains entries like

message.createmobchannelid=നിങ്ങളുടെ ജനകീയ ചാനല്?വിലാസം ഉണ്ടാക്കൂ...

user.firstName=പേര്?

user.secondName=പിന്?പേര്?

user.Email=ഇ-മെയില്?

user.MobileNo=മൊബൈല്?നമ്പര്?

user.password=രഹസ്യ മന്ത്രം

user.sex=ലിംഗം

user.sex.male=ആണ്?

user.sex.female=പെണ്ണ്?

user.dob=ജനന തീയതി

I have converted this to native2ascii also ..so lets call it version 2

now i have a login page

<%@page pageEncoding="UTF-8"%>

<%@ page language="java" contentType="text/html;charset=UTF-8" %>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>

<%@ taglib uri="/WEB-INF/c-rt.tld" prefix="c"%>

<%@ taglib uri="/WEB-INF/fmt-rt.tld" prefix="fmt"%>

<fmt:setLocale value="${locale}"/>

<fmt:bundle basename="home" >

<img src="<%=request.getContextPath()%>/images/login.png" align="absbottom">

<c:choose>

<c:when test="${empty userAccount}" >

<html:link action="/register?dispatch=register" >

<fmt:message key="registration.registernow" />

</html:link>

<c:if test="${userMessage == 'SIGNIN_FAILED'}">

<fmt:message key="message.sigin.failed"/>

</c:if>

<c:if test="${userMessage == 'REGISTRATION_NOT_CONFIRMED'}" >

<fmt:message key="message.signin.notconfirmed"/>

</c:if>

<html:form method="POST" action ="/submitLogIn">

<table class="login_contentimg" cellspacing="0" cellpadding="0">

<tr>

<td nowrap>

<fmt:message key="user.Email" />

</td>

<td>

<input name="userEmail" type="text" class="loginTextBox">

</td>

</tr>

<tr>

<td>

<fmt:message key="user.password"/>

</td>

<td>

<input name="userPassword" type="password" class="loginTextBox">

</td>

</tr>

<tr>

<td align="right">

<input type="checkbox" name="rememberMe" value="rememberMe" />

</td>

<td>

<fmt:message key="signin.rememberme" />

</td>

</tr>

<tr>

<td></td>

<td>

<html:submit><fmt:message key="signin.signin"/></html:submit>

<html:link action="/forgotpassword?dispatch=forgotpassword">

<fmt:message key="signin.forgotPassword" />

</html:link>

</td>

</tr>

</table>

</html:form>

</c:when>

<c:otherwise>

<html:link action="/logout?dispatch=logout">

<fmt:message key="signin.logout" />

</html:link>

<table class="login_contentimg" cellspacing="0" cellpadding="0">

<tr>

<td nowrap>

<fmt:message key="signin.welcome" />

</td>

<td>

${userAccount.userFirstName} ${userAccount.userLastName}

</td>

</tr>

<tr>

<td></td>

<td>

<html:link action="/changepassword?dispatch=changepassword">

<fmt:message key="message.changepassword" />

</html:link>

</td>

</tr>

</table>

</c:otherwise>

</c:choose>

</fmt:bundle>

This is included in a tiles file .. the mail layout file is lik

<%@page pageEncoding="UTF-8"%>

<%@ page language="java" contentType="text/html;charset=UTF-8" %>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>

<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

"http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<title>::.MobChannel</title>

<link rel="stylesheet" href="<%=request.getContextPath()%>/css/mobchannel.css" />

</head>

<body>

<!-- Main Layout Starts -->

<div id="layout">

<!-- Header Starts -->

<div id="header">

<!-- Header Content Comes here -->

<tiles:insert attribute="header" />

</div>

<!-- Header Ends -->

<div id="content">

<html:errors/>

<tiles:insert attribute="body" />

<!-- Content Ends -->

</div>

<div id ="footer" >

<tiles:insert attribute="footer" />

</div>

</div>

</body>

</html>

My Problem is after using both nati2ascii version 2 and version 1 of home.properties in malayalam i am getting junk.

I am setting session.setAttribute(locale,"ml_IN") - just to tell where jstl:setLocale gets it's value from.

I have been burning my head over this for almost a week and i can't get this freaking thing to work.. Guruuuuus help. I am at your feet.

[6179 byte] By [PraveenGeorgea] at [2007-11-26 19:46:00]
# 1

Hmm - I assume you are using J2EE, so that you are not running into the problem related to the servlet version described here:

http://www.inter-locale.com/codeset1.jsp:

"...prior to J2EE 1.4 (Servlet 2.4), the JSTL and other taglib directives related to getting and setting the page Locale caused the page to change encoding to one inferred by the Locale."

When you say you are "getting junk", exactly what kind of junk is that? Provide an example of one of your strings in UTF-8 and the same string as you see it in your page. That might give a hint.

one_danea at 2007-7-9 22:31:31 > top of Java-index,Desktop,I18N...
# 2

dane,

Thanks a lot for the response..

I am using Servlet API 2.4, essentially tomcat 5.5.20.

Here is my user.email -native2asciied version

user.Email=\u00e0\u00b4\u2021-\u00e0\u00b4\u00ae\u00e0\u00b5\u2020\u00e0\u00b4\u00af\u00e0\u00b4\u00bf\u00e0\u00b4\u00b2\u00e0\u00b5\ufffd\u00e2\u20ac\ufffd

In my mother toungue it is

user.Email=ഇ-മെയില്‍

You can read it if you have AnjaliOld font installed.

my meta on html is <meta http-equiv="content-type" content="text/html; charset=UTF-8">

Now on the page it comes user.Email comes as

啻?啻祮啻纯啻侧?#65533;鈥�

Thanks

PraveenGeorgea at 2007-7-9 22:31:31 > top of Java-index,Desktop,I18N...
# 3
You must run native2ascii incorrectly then. When I run native2ascii against the Malayalam string ഇ-മെയില്‍ I get \u0d07-\u0d2e\u0d46\u0d2f\u0d3f\u0d32\u0d4d\u200dAnd when I use that in my properties file it displays just fine in my
one_danea at 2007-7-9 22:31:31 > top of Java-index,Desktop,I18N...
# 4
WOW that worked perfectly fine . dane thanks a lot. I was missing the encodig utf-8 bit part in native2ascii . wow i can't imagine you figured it out that fast.. thanks a ton ..
PraveenGeorgea at 2007-7-9 22:31:31 > top of Java-index,Desktop,I18N...