Next: Character and String Functions in C Locale, Previous: Iterating through strings, Up: Strings [Contents][Index]
The GNU Coding Standards, section https://www.gnu.org/prep/standards/html_node/Semantics.html, specifies:
Utilities reading files should not drop NUL characters, or any other nonprinting characters. |
When it is a requirement to store NUL characters in strings, a variant of the C strings is needed. Gnulib offers a “string descriptor” type for this purpose. See Handling strings with NUL characters.
All remarks regarding encodings and multibyte characters in the previous section apply to string descriptors as well.