Solved

UNICODE

Posted on 2003-10-28
5
2,316 Views
Last Modified: 2007-12-19
Hi,

Will Oracle does encoding conversion on server side ??
If it by default converts all strings to Unicode,
Which foramt it will use?? single-byte or two-byte format?

Thanks in advance
Srinib
0
Comment
Question by:srinib
  • 3
  • 2
5 Comments
 
LVL 1

Author Comment

by:srinib
ID: 9639086
I need to store my data in UNICODE two-byte format.
Will ORACLE do it by default??
If not, What should i do??
0
 
LVL 48

Expert Comment

by:schwertner
ID: 9640349
By creating the Database you should choose the Character Set. The best choice is ALU32UTF8, but it can be used only in pure 9i Environment (not with 8i clients). The strings will be converted to the DB character set automatically.


AL16UTF16 is fixed-width 2 bytes per character. It is supported for NCHAR, NVARCHAR2 and NCLOB only (national character set). It is not a binary superset of any other Oracle character set. AL16UTF16 corresponds to Unicode UTF-16 encoding.

AL32UTF8 is a varying width 1-4 bytes per character. It is supported for CHAR, VARCHAR2, LONG and CLOB only (database character set). It is a binary superset of UTF8 (in 9.2 only) and US7ASCII. AL32UTF8 corresponds to Unicode UTF-8 encoding.

UTF8 is a varying width 1-3 bytes per character Unicode encoding. It is supported for both database and national character sets. It is a binary superset of US7ASCII. UTF8 corresponds to Unicode CESU-8 encoding.

The difference between UTF8 and AL32UTF8 are:
- UTF8 stores Unicode characters with code points > U+FFFF as two surrogate characters, three bytes each
- AL32UTF8 stores Unicode characters with code points > U+FFFF as one four-byte character
- UTF8 will not be updated anymore when new Unicode versions are released, only AL32UTF8 and AL16UTF16 will.

Due to compatibility problems with pre-9i versions use UTF8 if you have Oracle8(i) clients connecting to the database. Use AL32UTF8 in pure Oracle9i environment.
0
 
LVL 1

Author Comment

by:srinib
ID: 9640639
Already the database is cretaed. I am using Oracle8i client..
If i change the charcter set of the database to AL16UTF16, will it change it two-byte format(i mean all the strings)?

In this case, i hope that i need not alter my tables from char to nchar etc.. to store in two byte format .

Thanks
Srinivas

0
 
LVL 48

Accepted Solution

by:
schwertner earned 50 total points
ID: 9641141
If the DB is empty it will be created in that char. set. If it is old DB you should export the whole DB, create a new one wit that char.set and import the whole DB.
0
 
LVL 1

Author Comment

by:srinib
ID: 9647593
Thanks schwertner..

Srinib
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that useā€¦
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question