HDF5
1.14.4.3
API Reference
|
The creation property, the choice of a character encoding, applies to attributes.
Function | Purpose |
---|---|
H5Pset_char_encoding/H5Pget_char_encoding | Sets/gets the character encoding used to encode link and attribute names. |
Functions | |
herr_t | H5Pget_char_encoding (hid_t plist_id, H5T_cset_t *encoding) |
Retrieves the character encoding used to create a link or attribute name. | |
herr_t | H5Pset_char_encoding (hid_t plist_id, H5T_cset_t encoding) |
Sets the character encoding used to encode link and attribute names. | |
herr_t H5Pget_char_encoding | ( | hid_t | plist_id, |
H5T_cset_t * | encoding | ||
) |
Retrieves the character encoding used to create a link or attribute name.
[in] | plist_id | Link creation or attribute creation property list identifier |
[out] | encoding | String encoding character set |
H5Pget_char_encoding() retrieves the character encoding used to encode link or attribute names that are created with the property list plist_id
.
Valid values for encoding
are defined in H5Tpublic.h and include the following:
H5T_CSET_ASCII | US ASCII |
H5T_CSET_UTF8 | UTF-8 Unicode encoding |
herr_t H5Pset_char_encoding | ( | hid_t | plist_id, |
H5T_cset_t | encoding | ||
) |
Sets the character encoding used to encode link and attribute names.
[in] | plist_id | Link creation or attribute creation property list identifier |
[in] | encoding | String encoding character set |
H5Pset_char_encoding() sets the character encoding used for the names of links (which provide the names by which objects are referenced) or attributes created with the property list plist_id
.
Valid values for encoding include the following:
H5T_CSET_ASCII | US ASCII |
H5T_CSET_UTF8 | UTF-8 Unicode encoding |
For example, if the character set for the property list plist_id
is set to H5T_CSET_UTF8, link names pointing to objects created with the link creation property list plist_id
will be encoded using the UTF-8 character set. Similarly, names of attributes created with the attribute creation property list plist_id
will be encoded as UTF-8.
ASCII and UTF-8 Unicode are the only currently supported character encodings. Extended ASCII encodings (for example, ISO 8859) are not supported. This encoding policy is not enforced by the HDF5 library. Using encodings other than ASCII and UTF-8 can lead to compatibility and usability problems.