Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Insert Statement put invalid character data into UTF8 database/column
sybrandb_at_yahoo.com wrote:
> Martin T. wrote:
> > Hi all. [Oracle 9i - 9.2.0.1.0]
> >
> > Can someone explain to me why a simple insert statements with no
> > encoding convertions manages to put an invalid string into a database
> > column?
> >
>
> Invalid setting of NLS_LANG on the client, if a client is involved.
>
> Check out NLS_LANG in your NLS_SESSION_PARAMETERS view.
>
Thank!
Finally I was able to repro the behaviour.
The problem was the encoding part of the NLS_LANG client environment
setting.
If NLS_LANG=XXX_YYY.WE8ISO8859P1 then a text file containing this
encoding will be converted when inserting into an UTF8 column.
However, if the language setting is NLS_LANG=XXX_YYY.UTF8 then no
conversion will take place and the ISO8859 bytes will just be inserted
into the UTF8 column.
If the client setting (NLS_LANG) is UTF8, then also the file has to be
UTF8 encoded.
best,
Martin
Received on Tue Jul 04 2006 - 06:13:17 CDT