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: NLS character settings

Re: NLS character settings

From: Chris O <itoys1>
Date: Thu, 4 Mar 2004 08:21:29 +1000
Message-ID: <40465a68$0$4227$afc38c87@news.optusnet.com.au>


"Robert Gallas" <gallasr_at_ustr.slposta.sk> wrote in message news:c24oqu$pil$1_at_news.telecom.sk...
> Hello,
>
> I have question about NLS character settings.
>
> We have database created in:
>
> NLS_CHARACTERSET WE8DEC
> NLS_NCHAR_CHARACTERSET WE8DEC
>
> 1st. scenario
> client NLS_LANG = AMERICAN_AMERICA.WE8DEC
> - in one session inserted character of byte value 9E
> - in the same session select returned character 9E
> Result is correct
>
> 2sn. scenario
> client NLS_LANG = AMERICAN_AMERICA.EE8MSWIN1250
> - in one session inserted character of byte value 9E
> - in the same session select returned character ?
> Result is incorrect
>
> I have never been confronted with NLS setting in oracle enviroment so I do
> not really understand what is going on in background when converting
> characters. I have thougth that when converting from client session NLS to
> server NLS to store character is the same conversion as reading character
> from server NLS converting to client session NLS just vice versa. So what
I
> do not understand shy oracle changes byte value of the character. Can
> samobody explain me this? Oracle is able to store 9E byte but just when
the
> session NLS and server NLS are same_ I have a little(much) confusion in
this
> NLS stuff.
>
> What I thought was that oracle session takes 9E in EE... converst it to XX
> in WE...(acording to combination of client NLS and server NLS) when
storing
> and vice versa when reading data if and only if the NLS combination of
> client and server is the same.
>
> Thanks in advance
> Robert
>
>

Hi Robert.

There are two points to note here:
1. Character set conversions do not guarantee a round trip. 2. You are dealing with characters not code point values.

I do not know what character 0x9E represents in either character set but presumable [based on your results] it represents a different character in each of the chosen character sets. On the client side you have chosen EE8MSWIN1250. When the character is passed to the server, the code-point value 0x9E is not simply passed to the server. Because they are different character sets, Oracle will first convert the character to a Unicode code-point [so the doco says] and then attempt to convert this Unicode character to the target character set [in your example WE8DEC]. In your example, the Unicode character is not able to be represented in WE8DEC so the replacement character [i.e. a '?'] is used.

When you use the same characterset on the client as on the server, Oracle does not perform any conversion [or validation for that matter].

Hope this helps.

Cheers Chris Received on Wed Mar 03 2004 - 16:21:29 CST

Original text of this message

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