Packing Codes for Unicode

By default, the W packing code is for Unicode characters. The U* packing code can also be used for holding Unicode characters. If the entity character set is Unicode, the C packing code can also be used for Unicode characters.

Fields with data type String can be used for Unicode. If a string field is a Unifield, it can hold bold, italic, and underline characters.

W Packing Code

By default, if a string field uses the W packing code, it can contain any Unicode character. However, some databases support only Unicode BMP (Basic Multilingual Plane ), or do not support Unicode at all.

To control the behavior of the W packing code in such circumstances, you can use the assignment setting $WIDE_CHAR_BEHAVIOR to set the behavior of all W String fields in your application. To set the behavior of W String fields in a specific entity, use the Wide Character Behavior property of the entity interface.

The value of Wide Character Behavior overrides the $WIDE_CHAR_BEHAVIOR setting.

Note:  Setting the assignment setting or property to use the character set, switches the W packing code to a C packing code, in which case you must also set the $DEF_CHARSET assignment setting or Character Set entity interface property.

U* Packing Code

It is possible to store Unicode data in fields with a U* packing code by setting the $META_IN_TRX assignment setting to 0. This causes the data to be stored in XML format, therefore, it can be used for holding Unicode characters.

C Packing Code

The C packing code is used for characters in an installable character set. This can be specified using the Character Set property of the entity interface, or the $DEF_CHARSET (if the Character Set is (default).

If the specified character set is Unicode, the C String fields are also used for Unicode characters.

Related Topics