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: what characterset to use?

Re: what characterset to use?

From: Martin T. <0xCDCDCDCD_at_gmx.at>
Date: Fri, 24 Aug 2007 12:40:45 +0200
Message-ID: <46ceb6b5$0$1346$834e42db@reader.greatnowhere.com>


Ben wrote:

> On Aug 23, 2:48 pm, sybra..._at_hccnet.nl wrote:

>> On Thu, 23 Aug 2007 07:02:10 -0700, Ben <bal..._at_comcast.net> wrote:
>>> I'm not saying it is feasible to have a database set to use US7ASCII
>>> as its character set. I'm simply saying that in the scenario that
>>> Sybrand listed, 1 database and 1 client both being set to us7ascii, I
>>> don't see the issue. UNLESS you introduce a client using a different
>>> character set.
>> Ok, again
>>
>> Client set to US7ASCII
>> Database set to US7ASCII
>> You send an eight bit character.
>> Oracle sees 7 bit client character set, 7 bit server character set
>> --->
>> HEY, I DON'T HAVE TO CONVERT ANY CHARACTER.
>> What will happen if all of a sudden someone decides to export using 7
>> bit NLS_LANG and import into 8 bit database.
>>
>> Please don't imply I'm making up fairy tales, I'm talking stories for
>> grown ups!!!!
>> REAL WORLD HORROR STORIES with customers getting GROSS!!!
>>
>> And yes: this explanation is on Metalink!!!
>>
>> --
> 
> I'm not implying anything. I'm trying to understand.
> 
> How do you insert an 8 bit character with a 7 bit client into a db
> with a 7 bit character set? Wouldn't that be a square peg round hole
> kind of thing? You of course wouldn't get the 8 bit character back out
> of the 7 bit db.
> 
> (...)

What you really need to understand is that the character sets (NLS_LANG) you tell Oracle about are ONLY there for conversion. Oracle doesn't give a damn if you have a database which is told it's UTF8 and the values residing in the VARCHAR2 columns are actually WE8ISO8859P2. Oracle doesn't care. Only if you try to retrieve this data with e.g. a JDBC driver, you will get a Java Exception telling you it could not convert the UTF8 data.

So the character sets of the clients and the DB are only there to tell oracle if it has to convert or not. And if they are the same, no conversion will take place. (And if the client "lies" you end up with crap in your DB.)

br,
Martin Received on Fri Aug 24 2007 - 05:40:45 CDT

Original text of this message

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