Tools for converting between other character encodings. More...
Classes | |
struct | sp::CharacterEncodings::UTF8 |
Character encoder for UTF-8. More... | |
Tools for converting between other character encodings.
These objects have an operator() that takes a single UTF-32 character (as a char32_t) and converts it to a byte representation for that character. These are objects rather than functions because this makes it easier to pass them as template arguments.
The specification of this representation is a pair: byte count, and bytes. This allows a single type to be returned even for variable-width encodings. The type of the byte array is different for different encodings.
Characters that cannot be encoded in the target encoding are converted as the absence of any characters.