Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: UTF8 note decoded when reading from the database

Re: UTF8 note decoded when reading from the database

From: Laurenz Albe <invite_at_spam.to.invalid>
Date: 19 Feb 2007 09:21:14 GMT
Message-ID: <1171876869.820565@proxy.dienste.wien.at>


In comp.databases.oracle.server johnny9_at_gmail.com wrote:
> Is there a recommended NLS_LANG setting (or other setting) to use when
> you have a server application that collects data from all over the
> world in a variety of languages?
>
> Basically we have UTF8 encoded files coming in from all over the world
> and we not only store the raw UTF8 data as a whole in a BLOB but we
> strip portions of it out and place them in a more normalized fashion
> (such as a person's name, location, a title, notes, etc.) The UTF8
> data is typically all in one language, but we can receive a file from
> Singapore, then one from Japan, then one from Spain, etc.
>
> Our database is "UTF8", how would we go about reading/writing to it in
> a variety of languages?
>
> If we set NLS_LANG on the client pc to AMERICA.UTF8 we can
> successfully write international characters to the DB fields (without
> doing any kind of explicit encoding in out code) but when we read back
> from the same fields the data looks as though it has not been decoded.
>
> I'm wondering if this is because the database is 10g and the client
> oracle drivers are 9.x?

No, this is a generic problem.

I am afraid that there will not be an easy solution to your problem.

If the data that you have to store are in different character sets, sou can either first convert them to UTF-8 yourself or have Oracle convert them for you by setting NLS_LANG to the character set OF THE DATA YOU WANT TO STORE. Note, however, that the client character set cannot be changed during a database session; if you need to change it, you'll have to disconnect and reconnect.

In both cases (convert is yourself or have Oracle convert it) you will need to know the character set of the data you want to store.

What is your database character set? UTF8 or AL32UTF8?

Yours,
Laurenz Albe Received on Mon Feb 19 2007 - 03:21:14 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US