RE: Reading Unicode codes from a text file in JSP (Was RE:posting of unicode data to servlet)

From: Sujit Sunthankar (sujit@cps.com.au)
Date: Mon Dec 04 2000 - 21:48:57 EST


Wow! that was really useful. Got my JSP to work with the ResourceBundle
class.

But I have question re. Unicode. The tags in the tag files (*.properties
files), I have japanese language coded in \uHHHH format. But if I code the
same file in decimal format; \uDD, I get garbage in the browser. Any
suggestions as to how I get hex as well as the decimal equivalent of a
Unicode to work using the ResourceBundle class. It's not that I need this
but it is to understand the implications of using hex and the decimal
equivalent Unicode.

Thks & Rgds
Sujit

-----Original Message-----
From: David Sitsky [mailto:sits@nuix.com.au]
Sent: Monday, 4 December 2000 9:32 AM
To: Unicode List
Subject: Re: Reading Unicode codes from a text file in JSP (Was
RE:posting of unicode data to servlet)

Check out the ResourceBundle class. It elegantly solves the issues you are
exploring now. Sun has a good tutorial on all this stuff at:

http://web2.java.sun.com/docs/books/tutorial/i18n/index.html

Cheers,
David

On Thu, 30 Nov 2000, Sujit Sunthankar wrote:
> Hi,
>
> Just on another similar topic;
>
> I am trying to define tags in Unicode and store them in an ascii file that
> I wish to read from within the JSP to create the appropriate resulting
> HTML. Thus if the user wishes to see the page in Japanese for eg. I want
to
> read the file called tags_jp.txt to create the page, and the file
> tags_jp.txt will have Japanese character symbols in Unicode for each tag.
> The page essentially is a data entry page. The tags are used to create
> prompts for data entry fields. Thus rather than having indivdual JSP
pages,
> I wish to have only one JSP but multiple tag files.
>
> I am quite new to Java, so could you advice as to ow I should access the
> file and which class/methods should I use to read the file.
>
> The tags file I wish to maintain will have the following structure:
>
> tag_1 \uHHHH
> tag_2 \uHHHH
> etc.
> etc.
>
> Any help would be appreciated.
>
> Thks & Rgds
> Sujit
>
> -----Original Message-----
> From: Bhalchandra Patil [mailto:bpatil@mahindrabt.com]
> Sent: Wednesday, 29 November 2000 9:23 PM
> To: Unicode List
> Subject: posting of unicode data to servlet
>
>
> Hi,
>
> i am running an servlet on weblogic ( jre 1.2). The html page should
accept
> input in any character set say chinese. That value is posted to the
> servlet. I want to retrieve the unicode value of the character in the
> servlet.
>
> In the html page, i have specified meta tag
> <META HTTP_EQUIV="Content-Type" content="text-html; charset="UTF-8">
>
> in servlet, i am using String str = request.getParameter("name")
> str.getBytes("UTF8") does not work.
>
> What should i do to get the unicode values of the characters entered.
>
> Please help!!!!!
>
> regards,
> bhala



This archive was generated by hypermail 2.1.2 : Tue Jul 10 2001 - 17:21:17 EDT