Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

Storing UTF-8 Data

Since a UTF-8 encoded string is comprised of ordinary ASCII characters (with code values between 0 and 127) and multi-byte characters (which have the highest-order bit set in each byte), they can be stored normally in any of c-treeDB API’s string or binary field types such as CT_STRING, CT_FSTRING, CT_4STRING, etc. It is up to the application to decipher the field data.

On the other hand, if a field holding a UTF-8 encoded string is part of a key segment, then you need to define an "Extended Key Segment" for that segment to allow c-treeDB API to apply the appropriate translations to the field data when building the key data. Please refer to the "Extended Key Segment Definition" section above for more details.