Encodings¶
Some types support encoding parameters.
#include <ndtypes.h>
/* Encoding for characters and strings */
enum ndt_encoding {
Ascii,
Utf8,
Utf16,
Utf32,
Ucs2,
};
Functions¶
enum ndt_encoding ndt_encoding_from_string(const char *s, ndt_context_t *ctx);
Convert a string to the corresponding enum value. The caller must use
ndt_err_occurred
to check for errors.
const char *ndt_encoding_as_string(enum ndt_encoding encoding);
Convert an encoding to its string representation.
size_t ndt_sizeof_encoding(enum ndt_encoding encoding);
Return the memory size of a single code point.
uint16_t ndt_alignof_encoding(enum ndt_encoding encoding);
Return the alignment of a single code point.