Pages

Thursday, July 6, 2023

Charcter set selection when creating a database. CHARACTER SET vs NATIONAL CHARACTER SET

Charcter set selection when creating a database

Common setting is:
CHARACTER SET AL32UTF8
NATIONAL CHARACTER SET AL16UTF16

CHARACTER SET vs NATIONAL CHARACTER SET

CHARACTER SET
AL32UTF8 - is the standard UTF-8 character set for database.

NATIONAL CHARACTER SET
An alternative character set that enables you to store Unicode character data in a database that does not have a Unicode database character set. 

Another reason for choosing a national character set is that the properties of a different character 
encoding scheme may be more desirable for extensive character processing operations.

AL16UTF16 It is the only available as a choice for the National Character Set. 
          It would potentially allow you to store Asian characters in less space becasue
          Most Asian characters require 3 bytes to encode in UTF-8 and 2 bytes to encode in UTF-16.
  

UTF-8 vs UTF-16
UTF-8
Encodes a character into a binary string of one, two, three, or four bytes. 
UTF-8 will start to use 3 or more bytes for the higher order characters.

UTF-16
Encodes a Unicode character into a string of either two or four bytes.
UTF-16 is better where ASCII is not predominant, since it uses 2 primary bytes per character.

No comments:

Post a Comment