|
PebbleOS
|
UTF-8 decoder (Bjoern Hoehrmann's DFA). More...
Macros | |
| #define | PBL_UTF8_ACCEPT 0U |
| Decoder state: a code point has been decoded, or decoding has not started. | |
| #define | PBL_UTF8_REJECT 12U |
| Decoder state: the input is not valid UTF-8. | |
Functions | |
| uint8_t | pbl_utf8_decode (uint8_t *state, uint32_t *codepoint, uint8_t byte) |
| Feed one byte to the UTF-8 decoder. | |
UTF-8 decoder (Bjoern Hoehrmann's DFA).
| #define PBL_UTF8_ACCEPT 0U |
Decoder state: a code point has been decoded, or decoding has not started.
| #define PBL_UTF8_REJECT 12U |
Decoder state: the input is not valid UTF-8.
Sticky until the state is reset.
| uint8_t pbl_utf8_decode | ( | uint8_t * | state, |
| uint32_t * | codepoint, | ||
| uint8_t | byte | ||
| ) |
Feed one byte to the UTF-8 decoder.
Start with state set to PBL_UTF8_ACCEPT. A code point is complete when the returned state is PBL_UTF8_ACCEPT. Overlong forms, surrogates and code points above U+10FFFF are rejected.
| [in,out] | state | Decoder state. |
| [in,out] | codepoint | Code point being decoded. |
| byte | Next input byte. |