ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
esphome::unicode Namespace Reference

Functions

uint32_t extract_unicode_codepoint (const char *utf8_str, size_t *length)
 Attempt to extract a 32 bit Unicode codepoint from a UTF-8 string.
 

Function Documentation

◆ extract_unicode_codepoint()

uint32_t esphome::unicode::extract_unicode_codepoint ( const char * utf8_str,
size_t * length )

Attempt to extract a 32 bit Unicode codepoint from a UTF-8 string.

If successful, return the codepoint and set the length to the number of bytes read. If the end of the string has been reached and a valid codepoint has not been found, return 0 and set the length to 0.

Parameters
utf8_strThe input string
lengthPointer to length storage
Returns
The extracted code point

Definition at line 5 of file unicode.cpp.