In my utf8 database:
SQL> select * from v$nls_parameters where parameter= 'NLS_CHARACTERSET';
PARAMETER
----------------------------------------------------------------
VALUE
----------------------------------------------------------------
NLS_CHARACTERSET
UTF8
create table utf_test (a varchar2(240);
Table created.
load a single row using this control file:
LOAD DATA
CHARACTERSET UTF8
INFILE 'utf_test.txt'
TRUNCATE
INTO TABLE utf_test
(a char (720))
using isqlplus -
select * from utf_test; -- I get one row
**) FireWall ÊøãÊ (é·íþÏ°à÷)¡¡2005/1êÅÓø Ñ¢Êࣺ12/1/2004-11/30/2005
SQL> select dump(a,1016) from UTF_TEST;
DUMP(A,1016)
--------------------------------------------------------------------------------
Typ=1 Len=79 CharacterSet=UTF8: 2a,2a,29,20,46,69,72,65,57,61,6c,6c,20,e7,9b,a3,
e8,a6,96,20,28,e5,86,97,e9,95,b7,e6,a7,8b,e6,88,90,29,e3,80,80,32,30,30,35,2f,31
,e6,9c,88,e5,ba,a6,20,e6,9c,9f,e9,96,93,ef,bc,9a,31,32,2f,31,2f,32,30,30,34,2d,3
1,31,2f,33,30,2f,32,30,30,35
SQL>
In my us7ascii database:
select * from v$nls_parameters where parameter= 'NLS_CHARACTERSET'
SQL> /
PARAMETER
----------------------------------------------------------------
VALUE
----------------------------------------------------------------
NLS_CHARACTERSET
US7ASCII
1 row selected.
SQL>
select * from v$nls_parameters where parameter = 'NLS_NCHAR_CHARACTERSET'
SQL> /
PARAMETER
----------------------------------------------------------------
VALUE
----------------------------------------------------------------
NLS_NCHAR_CHARACTERSET
AL16UTF16
SQL>create table utf_test (a nvarchar2(240);
Table created.
load the same single row using this control file:
LOAD DATA
CHARACTERSET UTF8
INFILE 'utf_test.txt'
TRUNCATE
INTO TABLE utf_test
(a char (240))
Using isqlplus -
SELECT * FROM UTF_TEST;
**) FireWall ¢¯¢¯ (¢¯¢¯¢¯¢¯) 2005/1¢¯¢¯ ¢¯¢¯:12/1/2004-11/30/2005
-- No more Japanese characters. --
SQL> select dump(a,1016) from UTF_TEST;
DUMP(A,1016)
-------------------------------------------------------------------------------
Typ=1 Len=110 CharacterSet=AL16UTF16: 0,2a,0,2a,0,29,0,20,0,46,0,69,0,72,0,65,0
,57,0,61,0,6c,0,6c,0,20,76,e3,89,96,0,20,0,28,51,97,95,77,69,cb,62,10,0,29,30,0
,0,32,0,30,0,30,0,35,0,2f,0,31,67,8,5e,a6,0,20,67,1f,95,93,ff,1a,0,31,0,32,0,2f
,0,31,0,2f,0,32,0,30,0,30,0,34,0,2d,0,31,0,31,0,2f,0,33,0,30,0,2f,0,32,0,30,0,3
0,0,35
1 row selected.
Looking at the dump I would think that the database has correctly loaded values in the nvarchar2 column, but using isqlplus I am not able to display them. Initially I thought that the loader is not loading the data correctly, so I asked my question..
I looked at the source of my web browser page:
This is from my connection to the utf8 database:
...
...
<!-- Copyright (c) Oracle Corporation 2000, 2003. All rights reserved. -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
...
...
**) FireWall ÊøãÊ (é·íþÏ°à÷)¡¡2005/1êÅÓø Ñ¢Êࣺ12/1/2004-11/30/2005
...
...
This is from my connection to the us7ascii database:
...
...
<meta http-equiv="Content-Type" content="text/html; charset=WINDOWS-1252">
...
**) FireWall ¢¯¢¯ (¢¯¢¯¢¯¢¯) 2005/1¢¯¢¯ ¢¯¢¯:12/1/2004-11/30/2005
...
...
My questions:
Why does US7ASCII database send the characters in ascii to the web browser even though it is coming off an nvarchar2 column? Is there any setting on the database or the session that will help me do that?
How do I set my isqlplus so that it senses that the data is from nvarchar2 column so that it does not default to charset=WINDOWS-1252?
Thanks for your help.