For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!
Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.
Oracle 11g install instructions recommends using AL32UTF8 verses US7ASCII. Would applications built for US7ASCII transparently support AL32UTF8?
user2304762 wrote: Oracle 11g install instructions recommends using AL32UTF8 verses US7ASCII. Would applications built for US7ASCII transparently support AL32UTF8?
user2304762 wrote:
The question above is A**BACKWARDS
A database configured with AL32UTF8 characterset would transparently support an application designed on US7ASCII database.
You can answer that question yourself:
1. ascii is a SINGLE BYTE character set - EVERY character has EXACTLY one byte
2. AL32UTF8 is a MULTI-BYTE character set A character can take 1, 2, 3 or even 4 bytes
Can a single byte transparently support characters that require 2, 3 or even 4 bytes?
Post your answer. Then read the entire doc section at:
http://docs.oracle.com/cd/B28359_01/server.111/b28298/ch2charset.htm
In single-byte character sets, the number of bytes and the number of characters in a string are the same. In multibyte character sets, a character or code point consists of one or more bytes. Calculating the number of characters based on byte lengths can be difficult in a variable-width character set. Calculating column lengths in bytes is called byte semantics, while measuring column lengths in characters is called character semantics. Character semantics is useful for defining the storage requirements for multibyte strings of varying widths. For example, in a Unicode database (AL32UTF8), suppose that you need to define a VARCHAR2 column that can store up to five Chinese characters together with five English characters. Using byte semantics, this column requires 15 bytes for the Chinese characters, which are three bytes long, and 5 bytes for the English characters, which are one byte long, for a total of 20 bytes. Using character semantics, the column requires 10 characters. The following expressions use byte semantics:
In single-byte character sets, the number of bytes and the number of characters in a string are the same. In multibyte character sets, a character or code point consists of one or more bytes. Calculating the number of characters based on byte lengths can be difficult in a variable-width character set. Calculating column lengths in bytes is called byte semantics, while measuring column lengths in characters is called character semantics.
Character semantics is useful for defining the storage requirements for multibyte strings of varying widths. For example, in a Unicode database (AL32UTF8), suppose that you need to define a VARCHAR2 column that can store up to five Chinese characters together with five English characters. Using byte semantics, this column requires 15 bytes for the Chinese characters, which are three bytes long, and 5 bytes for the English characters, which are one byte long, for a total of 20 bytes. Using character semantics, the column requires 10 characters.
VARCHAR2
The following expressions use byte semantics:
>>Oracle 11g install instructions recommends using AL32UTF8 verses US7ASCII. Would applications built for US7ASCII transparently support >>AL32UTF8?
Oracle recommends it does not mean you must use that. If your application is suppose to work using only a single character set (i.e. english ) you do not need to use AL32UTF8. By using AL32UTF8 you will increase the amount of space that is required to store the data.
Oracle recommends it in order to support multiple languages character set within the same database.
HTH,
Pradeep
> By using AL32UTF8 you will increase the amount of space that is required to store the data.
Not true. If you use AL32UTF8 and only store single byte characters, the space is exactly the same.
12cdb wrote: >>Oracle 11g install instructions recommends using AL32UTF8 verses US7ASCII. Would applications built for US7ASCII transparently support >>AL32UTF8? Oracle recommends it does not mean you must use that. If your application is suppose to work using only a single character set (i.e. english ) you do not need to use AL32UTF8. By using AL32UTF8 you will increase the amount of space that is required to store the data. Oracle recommends it in order to support multiple languages character set within the same database. HTH, Pradeep
12cdb wrote:
But you really don't want to use US7ASCII. Some applications will stuff in 8 bit characters, then later if you import/export Oracle will helpfully translate those to the wrong characters. This was a classic problem for many versions. Sometimes Oracle recommendations are worth listening to.
I personally dealt with several "we will never use anything but English" situations. Sometimes they were just plain wrong, others were more subtle, like applications using their own counters stuck into chars. Exp/imp would change the counters because the translations used 8 bits.
Of course, it could be worse.
To answer your question and clarify some of the aspects mentioned in other answers:
Even if an application does not fulfill condition 1.1, it can often still be made work with AL32UTF8 database after minimal changes.
Thanks,
Sergiusz