Expand description
UTF-8 character encoding, validation, and stream parsing utilities.
Constants§
Functions§
- ellipsize_
to_ max_ bytes - Ellipsize a string to a maximum byte length, respecting UTF-8 boundaries.
- first_
char_ of_ utf8_ string - Return a character (or for invalid part of the string, the replacement character) of a UTF-8 string as bytes, as well as the number of input bytes consumed. For valid UTF-8 input, the number of input bytes will always match the number of output bytes.
- first_
char_ of_ utf8_ string_ lossless - Return a character or invalid part of a UTF-8 string as bytes, as well as the number of input bytes consumed.
- to_
ascii_ translit - Roughly transliterate a UTF-8 string to ASCII. I have in mind a new transliteration “transformation” (defined in transformations.csv) which could be applied in some general way as a fallback encoding handler (that isn’t a concept that exists anywhere in code yet, but basically a generalization of the “replacement character” idea where a Dc format chain could be defined to perform more complex conversion operations on text during an export).
- truncate_
to_ max_ bytes - Truncate a string to a maximum byte length, respecting UTF-8 boundaries.
- utf8_
from_ scalar