diff options
Diffstat (limited to 'prism/encoding.h')
| -rw-r--r-- | prism/encoding.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/prism/encoding.h b/prism/encoding.h index 8fe01aea69..7ba1695de8 100644 --- a/prism/encoding.h +++ b/prism/encoding.h @@ -80,6 +80,16 @@ typedef struct { #define PRISM_ENCODING_UPPERCASE_BIT 1 << 2 /** + * Return the size of the next character in the UTF-8 encoding. + * + * @param b The bytes to read. + * @param n The number of bytes that can be read. + * @returns The number of bytes that the next character takes if it is valid in + * the encoding, or 0 if it is not. + */ +size_t pm_encoding_utf_8_char_width(const uint8_t *b, ptrdiff_t n); + +/** * Return the size of the next character in the UTF-8 encoding if it is an * alphabetical character. * |
