Charsets, i18n and confusion

2000-10-12 Thread Mike Cannon-Brookes

Guys,

I really need some help here - anything you can all do to help is fantastic.

I'm trying to build a site in Big 5 characters, but sometimes they come up
and sometimes they're just garbled. To complicate matters, sometimes people
are submitting the form with Big5 characters.

Here's the scenario:

Big 5 text - web form - EJB - Database...

DB - EJB - getter method - web site

What encodings should I use where? If the text is Big5 encoded ASCII (is
that right? text typed from a Big5 keyboard into the form) do I need to
manually convert it to unicode somehow before putting it in the entity bean?

Does it matter what encoding the entry form page is in? Will it affect the
result?

Are there any current bugs with i18n that you know of?

Has anyone used Big5 with Orion extensively?

Cheers - you'll save my bacon,
Mike





Re: Charsets, i18n and confusion

2000-10-12 Thread Richard Chuo
Hello Mike,

DB -> EJB -> getter method -> web site

What encodings should I use where? If the text is Big5 encoded ASCII (is
that right? text typed from a Big5 keyboard into the form) do I need to
manually convert it to unicode somehow before putting it in the entity bean?

Did you changed the encoding when getting the parameters from the web form?
We use java.io.InputStreamReader to change the encoding to "Big5".

Does it matter what encoding the entry form page is in? Will it affect the
result?
Yes, it does. 

Good luck!
Richard Chuo 

RE: Charsets, i18n and confusion

2000-10-12 Thread Mike Cannon-Brookes

Richard,

Thanks for this - would you mind just verifying the procedure? I'm sure it
will be useful to others in the future for the archives.

1. My web form arrives to the user encoded in Big5 (using
default-charset="Big5" in the orion-web.xml file).

2. The user fills in lots of Big5 characters (which are represented on
screen, but underneath are just Big5 encoded ASCII correct?)

3. When the form is submitted, the encoding of the form is Big5.

First Q: Can you give me a quick code snippet to convert that to a storable
format? Do I need to convert it to Unicode?

4. The data is now stored in the EJB in a portable manner.

5. A user requests to view a page, and the EJB is retrieved, it's content
accessed through ejb.getParameter() and displayed on my page. The page is
encoded again in Big5 - it should just turn up now correct?

Thanks in advance - you really are a lifesaver,

Mike

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Richard Chuo
Sent: Friday, October 13, 2000 12:22 AM
To: Orion-Interest
Subject: Re: Charsets, i18n and confusion


Hello Mike,

DB - EJB - getter method - web site

What encodings should I use where? If the text is Big5 encoded ASCII (is
that right? text typed from a Big5 keyboard into the form) do I need to
manually convert it to unicode somehow before putting it in the entity bean?

Did you changed the encoding when getting the parameters from the web form?
We use java.io.InputStreamReader to change the encoding to "Big5".

Does it matter what encoding the entry form page is in? Will it affect the
result?
Yes, it does.

Good luck!
Richard Chuo