tags:

views:

45

answers:

3

Hi, I am creating Web application using the struts 1.2. On which I have to add the Hindi language support to my Web application.I have created the Application_hi.properties file in which I have key equal to Hindi word. But it is giving the error like "some character cannot be map using ISO-8859-1 character encoding".

thanks in advance................

+1  A: 

Hindi is does not come under ISO-8859-1 Character encoding, The contents in the properties files are encoded in the 8-bit characters of ISO 8859-1 (aka Latin-1) which contains most “regular” characters but lacks support for language specific characters like ü Ü é or ñ.

So i was using the other utilities to convert from one encoding to the other encoding I think you can check this link for more information and may be handy for you 1) http://okapi.sourceforge.net/Release/Rainbow/Help/index.html 2)http://okapi.sourceforge.net/Release/Utilities/Help/encodingconversion.htm

Hope this helps!!!!

harigm
A: 

You have to use UTF-8 character encoding.

how to use UTF-8 character encoding in struts application.
Vipin Nemade
struts-config:<controller contentType="text/html;charset=UTF-8"/>Jsp page directive:<%@ page contentType="text/html;charset=UTF-8" pageEncoding="utf-8"%>
A: 

The problem arises as Java Properties file use ISO-8859-1 encoding which does not have Hindi characters. You can use native2ascii.exe tool on your ApplicationResource.properties file which will convert all characters to Ascii escaped.

EDIT1: Syntax would be JDK\bin>native2ascii prop.properties prop_hi.properties

References: http://forums.sun.com/thread.jspa?threadID=5269971

VinAy