Hi Tom,

Thanks for sharing your experiences to me and to all in the mailing list
regarding the i18n.

I'm really interested in knowing the difficulties in building the i18n
application you mentioned below. I'm currently designing an enterprise
application. And I would like to decrease the development time and the no.
of application support problems by utilizing the struts framework.

I have made a "proof-of-concept" prototype which loads zh_CN, zh_HK and
en_US characters in UTF-8 encoding. With the help of the experts here, i
have made it work. I have also make a form-bean and corresponding actions to
retrieve the data captured from the UTF-8 browser, i can get the data
correctly displayed at the backend (in UTF-8 tomcat console) which is HPUX
11i having LANG=zh_HK.utf8

At frontend, I have tested with 3 Intel-based PCs,
1. W2K pro - locale = en_US, IE with language en_US
2. W2K pro - locale = zh_gb, IE with language zh_gb
3. W2K pro - locale = zh_hk, IE with language zh_hk

We noticed that there are conversions between the window console and HTML in
browser, i.e. when user type in characters, Windows will change the encoding
to UTF-8 from its system locale and put those internal code to the inputs. I
believe that's why i can receive the right characters.

I am thinking if there're some tricks you have noticed that I'm really
interested to know. Could you please share with me?

Thanks a lot, please comment!

Regards,
Eric

----- Original Message -----
From: "Tom" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 29, 2002 12:13 AM
Subject: Re: ApplicationResources in UTF-8


>
> Hi,
>
> I have being struggled with the i18n of the Struts
> framework, I understand the problem that Eric is
> facing.
>
> Let me explain here what I have explored about the
> i18n given by the Struts.
>
> Bascially, the i18n ONLY supports unicode / UTF-8 page
> encoding. That is, WHATEVER LOCALE YOU USE, the page
> generated should be encoded in UTF-8. As unicode
> almost covers all the languages of this funny world,
> using unicode is the simple way for developing i18n
> application.
>
> Therefore, referring to the page,
> http://www.anassina.com/struts/i18n/i18n.html, it
> tells you to use the native2ascii program to covert
> file encoding of the resource files to UTF. And you
> will have to add, <%@ page contentType="text/html;
> charset=UTF-8" %>, into your pages to let browsers to
> use UTF-8 encoding. Otherwise, the browsers will not
> know which encoding it should use and it will use the
> default encoding.
>
> For the Eric's case, I believe that he want to
> internationalize the application using the following
> pairs of locale and corresponding charset encoding.
> locale encoding
> en_US  iso8859-1
> zh_HK  BIG5
> zh_CN  GB2312
>
> But this sort of i18n application cannot be easily
> done with Struts, unless you create some classes for
> convering encoding of "String" data from one encoding
> to another one and vice versa. For instance, if the
> ecoding of user's browser is set to BIG5, String used
> to store the data obtained from the browser will be
> set to BIG5. If the backend database server can only
> process unicode data, then data will not be stored
> properly. If the data is retrived back from the
> database, data would probably be displayed as "????".
>
> I hope this problem would be addressed in the next
> release of Struts. Unicode / UTF is good for
> developing i18n application, but the majority of users
> especially the Asian users would have problems.
>
> If you visit
> http://cn.yahoo.com
> http://tw.yahoo.com
> http://hk.yahoo.com
> http://www.ibm.com/cn
> http://www.ibm.com/tw/
> http://www.ibm.com
>
> you will find that these large scale web site dos use
> specific encoding method but NOT UNICODE/UTF to
> localize their websites.
>
> Regards,
> Tom
>
> This link works for me
>
> http://www.anassina.com/struts/i18n/i18n.html
>
> -D
> ----- Original Message -----
> From: "Eric Tse" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Friday, December 27, 2002 11:57 AM
> Subject: ApplicationResources in UTF-8
>
>
> > Hi Vipul,
> >
> > Thanks for your mail. I know what you mean. But even
> I tried to set
> the
> > locale to hk, it works neither :)
> >
> > I know the root cause to my problem. The filename of
> application
> resource
> > should be "ApplicationResources_zh-HK.properties"
> instead of
> > "ApplicationResources_zh_hk.properties".
> >
> > rana >> thanks!
> >
> > BTW, when i load the message resource file in UTF-8
> formats, the
> browser
> > windows does not change the default encoding to
> UTF-8. I can see the
> > characters correctly if i manually switch the
> browser codeset.
> >
> > But when I added page
> contentType="text/html;charset=utf-8" or
> > "pageEncoding=utf-8" at JSP page directive, the
> characters become
> > unrecognized symbols. I also tried to include
> > contentType="text/html;charset=UTF-8" in controller
> element of
> > struts-config.xml. Not work neither.
> >
> > Any idea?
> >
> > Regards,
> > Eric
> >
> > ----- Original Message -----
> > From: "Vipul Sanghi" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> > Sent: Thursday, December 26, 2002 1:39 PM
> > Subject: RE: ApplicationResources
> >
> >
> > > The locale that you are specifying does not
> include the country
> extention.
> > > It only knows of zh because you are probably doing
> new
> Locale("zh").
> You
> > > have to use the country variant when you
> instantiate and set the
> locale
> i
> > > think it is you have to do new Locale("zh", "hk")
> to pick
> traditional
> > > chinese etc.
> > >
> > > Vipul
> > >
> > > -----Original Message-----
> > > From: Eric Tse [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, December 26, 2002 11:27 AM
> > > To: Struts Users Mailing List
> > > Subject: ApplicationResources
> > >
> > >
> > > Dear all,
> > >
> > > I am trying to feed in 3 languages on my web, i.e.
> English (en-us),
> > > Traditional Chinese (zh-hk), and Simplified
> Chinese (zh-cn).
> > >
> > > I named the application resources as follows:
> > >
> > > ApplicationResources.properties           (for
> en-us)
> > > ApplicationResources_zh.properties          (for
> zh-hk)
> > >
> > > they work!! But when the following settings
> apply....
> > >
> > > ApplicationResources.properties           (for
> en-us)
> > > ApplicationResources_zh_hk.properties
> (for zh-hk)
> > > ApplicationResources_zh_cn.properties
> (for zh-cn)
> > >
> > > only en-us works! :~(
> > >
> > > any hint?
> > >
> > > Regards,
> > > eric
> > >
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
>
>
>
>
> =====
> Tom
> mailto:[EMAIL PROTECTED]
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to