You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ஆமாச்சு <am...@ubuntu.com> on 2007/05/13 08:18:20 UTC

Problem with text encoding..

Hi,

I am using Kubuntu edgy OS..

I installed Netbeans yesterday...

The installation went smooth and fine...

here are the setup I have, 

1) JDK - 1.5.0_11
2) Netbeans - netbeans-5.5
3) Tomcat - Bundled with Netbeans...

I thought of developing a Struts application in my Language - Tamil... 

so followed the instructions in 

http://www.netbeans.org/kb/50/quickstart-webapps-struts.html

replaced the text/strings in .jsp pages to my language...

also replaced the text/ string in ApplicationResource.properties file to my language...

Problem #1:

In Netbeans IDE the text display wasn't proper.. both in .jsp and ApplicationResource.properties files.. in .jsp it was squares... and in ApplicationResource.properties i had some junk values... 

so used Kate text editor to edit the .jsp file and ApplicationResource.properties files...

after completing i gave F6 and ran it.. it was successful.. The firefox browser opened... and the action was called..

Problem #2:

but the Tamil text that I had given in the .jsp file was properly displayed... The text that i gave in ApplicationResource.properties file wasn't displayed correctly...

I have uploaded the screenshot in the link given below.... The junk values can be identified as those next to "Your Name" in English..

http://flickr.com/photos/7841307@N06/495583036/

Kindly help me in fixing Problem #1 & #2..

Thank You..

-- 
அன்புடன்,
ஆமாச்சு.
https://wiki.ubuntu.com/sriramadas
http://amachu.net

சொல்லில் உயர்வு தமிழ்ச் சொல்லே -  அதைத்
தொழுது படித்திடடி பாப்பா
செல்வம் நிறைந்தஹிந்து ஸ்தானம் - அதைத்
தினமும் புகழ்ந்திடடி பாப்பா

Re: Problem with text encoding..

Posted by ஆமாச்சு <am...@ubuntu.com>.
On Sunday 13 May 2007 19:04, Christopher Schultz wrote:
> Did you make sure that ApplicationResource.properties was saved in
> ISO-8859-1 encoding with your Tamil characters written in Unicode
> escapes like \u1234? If you have bare Tamil characters in your file it
> will not work. You must use the Unicode escapes to make it work.
>

Thank you for the reply itclicked :-)

and would like to share this link.. for character to code conversion 

http://people.w3.org/rishida/scripts/uniview/conversion.php

Regards...

-- 
அன்புடன்,
ஆமாச்சு.
https://wiki.ubuntu.com/sriramadas
http://amachu.net

சொல்லில் உயர்வு தமிழ்ச் சொல்லே -  அதைத்
தொழுது படித்திடடி பாப்பா
செல்வம் நிறைந்தஹிந்து ஸ்தானம் - அதைத்
தினமும் புகழ்ந்திடடி பாப்பா

Re: Problem with text encoding..

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

ஆமாச்சு,

ஆமாச்சு wrote:
> also replaced the text/ string in ApplicationResource.properties file
> to my language...

Did you make sure that ApplicationResource.properties was saved in
ISO-8859-1 encoding with your Tamil characters written in Unicode
escapes like \u1234? If you have bare Tamil characters in your file it
will not work. You must use the Unicode escapes to make it work.

I found a great utility called Attesoro (http://attesoro.org/) that
helps you translate Java properties files. It displays everything
naturally on the screen and in it's simple text editor, but saves all
the properties files in the right encoding, etc. so you don't have to
worry about the escapes.

You can also use the "native2ascii" program that comes with Java. You
will have to specify the input encoding (UTF-8 shown here, please use
your own):

$ native2ascii -encoding UTF-8 ApplicationResource.properties out.props

The file out.props should contain the correct encoding and escapes.

> Problem #1:
> 
> In Netbeans IDE the text display wasn't proper.. both in .jsp and
> ApplicationResource.properties files.. in .jsp it was squares... and
> in ApplicationResource.properties i had some junk values...

See the above note about using Unicode escapes. Also, I wonder if your
Java installation has the correct font installed (or configured to
display the correct OS font when you request that one). You /do/ have
the correct font installed in your OS to display Tamil, yes?

> Problem #2:
> 
> but the Tamil text that I had given in the .jsp file was properly
> displayed... The text that i gave in ApplicationResource.properties
> file wasn't displayed correctly...
> 
> I have uploaded the screenshot in the link given below.... The junk
> values can be identified as those next to "Your Name" in English..

I think you probably are trying to use UTF-8 encoding for your
properties file. Change it to ISO-8859-1 with Unicode escapes and that
should work.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGRxP99CaO5/Lv0PARAuGKAJsGG90h9wEw+bsHrPtJ0lZXRMU3HwCgsz9O
2t8H9h3Csw5wqDh8i3GF9Ms=
=4f8/
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org