UTF8 Client Character Set Support - Teradata Database

International Character Set Support

Product
Teradata Database
Release Number
15.10
Language
English (United States)
Last Update
2018-09-25
dita:id
B035-1125
lifecycle
previous
Product Category
Teradata® Database

The Teradata Universal Coded Character Set Transformation Format (UTF8) client character set supports UTF8, a standard way of encoding Unicode character data that is optimized for backward compatibility with ASCII. This character set is usable for all languages. In Teradata UTF8, a character can consist of one to three bytes.

The UTF8 client character set is permanently enabled for use in Teradata Database.

 

IF a byte in a UTF8 string is …

THEN it …

less than 0x80

represents the same character defined by standard ASCII.

greater than or equal to 0x80

is part of a multibyte sequence and is not a standard ASCII character.

To determine the length of a byte sequence in UTF8, examine the first byte.

 

IF the...

THEN the sequence is...

high order bit is zero

one byte long.

This leaves seven bits to encode information.

If a character has a Unicode value that can be represented in seven bits, it is represented as a byte containing the Unicode value. For example, Unicode value 0x0041 is transformed to UTF8 byte 0x41.

three high order bits are 110

a two-byte sequence.

The second byte has the two high order bits set to 10. There are five free bits in the first byte and six free bits in the second byte. This allows eleven bits to represent a numeric value.

If a character has a Unicode value that can be represented in eleven bits, and cannot be represented by a shorter UTF8 sequence, then it is represented as two bytes, where the free bits contain the Unicode value. For example, Unicode value 0x03F1 is transformed to UTF8 byte sequence 0xCF 0xB1.

four high order bits are 1110

a three byte sequence.

The second and third bytes have the two high order bits set to 10. There are four free bits in the first byte and six free bits in each of the second and third bytes. This allows sixteen bits to represent a numeric value.

If a character has a Unicode value that can be represented in sixteen bits, and can not be represented by a shorter UTF8 sequence, it is represented as three bytes, where the free bits contain the Unicode value (for example, Unicode value 0x3000 is transformed to UTF8 byte sequence 0xE3 0x80 0x80).

The KANJI1 server character set is ambiguous with regards to multibyte characters and some single-byte characters, and cannot be reliably translated to UTF8.

For best results, use the UNICODE server character set with the UTF8 session character set, unless the KANJI1 server character set is required.