Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Oracle > Encoding issue on 9i

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-12-07, 04:58
bpereira bpereira is offline
Registered User
 
Join Date: Oct 2007
Posts: 5
Encoding issue on 9i

Hi,

I am trying to load a few CSV files into Oracle using the sqlldr - The files are encoded using ISO-8859-1 - The database character set is also set to Western European ISO-8859-1, However, once imported some of the characters appear as inverted question marks - the characters are the plus minus character and the super script 2 - Both these character are supported by the ISO-8859-1 - Any idea why this is happening and what's the workaround? - Also the same imported on a Windows machine using UTF-8 as the characterset works fine

Regards
Reply With Quote
  #2 (permalink)  
Old 10-12-07, 11:51
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 1,952
Talking



Set the NLS_LANG environment variable to correct encoding.

__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
  #3 (permalink)  
Old 10-12-07, 14:59
bpereira bpereira is offline
Registered User
 
Join Date: Oct 2007
Posts: 5
Encoding Issue

Hi,

I have the NLS_LANG set to AMERICAN_AMERICA.WE8ISO8859P1 - Should it be set to something else??

Regards
Reply With Quote
  #4 (permalink)  
Old 10-13-07, 10:10
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 1,952
Talking


It also has to be set when you run the utility to LOOK at the data which may have loaded OK.


__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
  #5 (permalink)  
Old 10-13-07, 22:05
bpereira bpereira is offline
Registered User
 
Join Date: Oct 2007
Posts: 5
Encoding

If you are referring to the .ctl file then yes i have tried that too - I ran a dump to determine what the database is actually storing and it seemed that it was storing ASCII codes - meaning that the loader must be interpreting the datafile as being ASCII characters - I added the characterset argument to the Load Data statement as US7ASCII hoping that the Loader would convert the codes to ISO 8859-1 (since the database characterset is set to that) - but had no luck

Thanks
Reply With Quote
  #6 (permalink)  
Old 10-13-07, 22:30
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 3,569
It would be MUCH more helpful & useful if you simply used CUT & PASTE (along with <code tags>) to actually show us exactly what you are doing & the complete output response.

We don't know Operating System name or version.
We don't know Oracle version (to 4 decimal places).

See what you are telling us everything should be OK & working.
The fact you are having a problem means, IMO, means you are mis-stating reality, but since we can't see what you are really doing & what you are actually seeing; we can't really provide any solution.

>I added the characterset argument to the Load Data statement as US7ASCII
Part of me suspects this is not what should have been done.
In 7-bit ASCII there is NO support any character value greater than 127; CHR(127)
>- the characters are the plus minus character and the super script 2 - Both these character are supported by the ISO-8859-1
but neither are supported in 7-bit ASCII (aka US7ASCII)

Please read & FOLLOW posting guidelines found below:
Guidance and resources for posters
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!

Last edited by anacedent : 10-13-07 at 23:03.
Reply With Quote
  #7 (permalink)  
Old 10-15-07, 16:54
bpereira bpereira is offline
Registered User
 
Join Date: Oct 2007
Posts: 5
Encoding Issue

This is the environment information:

Oracle9i Enterprise Edition Release 9.2.0.4.0 on a Linux kernel version 2.6 (Fedora Core 3)

And this is the NLS_Lang and database character settings:

SQL> HOST echo $NLS_LANG;
AMERICAN_AMERICA.WE8ISO8859P1

SQL> SELECT * from NLS_DATABASE_PARAMETERS;

PARAMETER VALUE
------------------------------ ----------------------------------------
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET WE8ISO8859P1
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM

PARAMETER VALUE
------------------------------ ----------------------------------------
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 9.2.0.4.0

20 rows selected.

Table Information:

SQL> desc productdescriptions;
Name Null? Type
----------------------------------------- -------- ----------------------------
PRODUCTID NOT NULL NUMBER
DESCRIPTION VARCHAR2(500)
ISDEFAULT NOT NULL NUMBER(1)
TYPE NOT NULL NUMBER
LOCALEID NOT NULL NUMBER


What i am trying to do is load a CSV file in the above table using the SQL loader - the CSV file contains the character ± which once loaded shows up as ¿

Thanks..
Reply With Quote
  #8 (permalink)  
Old 10-16-07, 12:30
bpereira bpereira is offline
Registered User
 
Join Date: Oct 2007
Posts: 5
Encoding Issue

Hi,

I have figured out the issue - It was due to the fact that the NLS_LANG was not set correctly - Setting it correctly before the run did the trick - thanks for all the help
Reply With Quote
  #9 (permalink)  
Old 10-19-07, 11:46
PMASchmed PMASchmed is offline
Registered User
 
Join Date: Jun 2004
Location: Long Island
Posts: 400
I find metalink.oracle.com to be extremely helpful.
Reply With Quote
  #10 (permalink)  
Old 10-19-07, 11:53
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 3,569
>I find metalink.oracle.com to be extremely helpful.
Please refrain form posting this truism against every thread just because it would be true.

I find the manuals located at http://tahiti.oracle.com to be extremely helpful.
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On