EasyGUI  Version v1.0
Unicode processing

Unicode processing functions with UTF-8 character encoding. More...

Data Structures

struct  gui_string_unicode_t
 UNICODE processing information structure. More...
 

Enumerations

enum  GUI_STRING_UNICODE_Result_t { UNICODE_OK = 0x00, UNICODE_ERROR, UNICODE_PROGRESS }
 UNICODE processing result information. More...
 

Functions

void gui_string_unicode_init (gui_string_unicode_t *const s)
 Initialize unicode processing structure. More...
 
GUI_STRING_UNICODE_Result_t gui_string_unicode_decode (gui_string_unicode_t *const s, const gui_char c)
 Decodes single input byte of unicode formatted text. More...
 
uint8_t gui_string_unicode_encode (const uint32_t c, gui_char *out)
 Encodes input character to UNICODE sequence of 1-4 bytes. More...
 

Detailed Description

Unicode processing functions with UTF-8 character encoding.

Enumeration Type Documentation

◆ GUI_STRING_UNICODE_Result_t

UNICODE processing result information.

Enumerator
UNICODE_OK 

Indicates function successfully decode unicode sequence of 1-4 bytes

UNICODE_ERROR 

Indicates function got an error with input data from 2nd to 4th byte in UTF-8 encoding

UNICODE_PROGRESS 

Indicates function decoding is still in progress and it waits for new character

Function Documentation

◆ gui_string_unicode_decode()

GUI_STRING_UNICODE_Result_t gui_string_unicode_decode ( gui_string_unicode_t *const  s,
const gui_char  c 
)

Decodes single input byte of unicode formatted text.

Parameters
[in,out]*sPointer to working gui_string_unicode_t structure for processing
[in]cCharacter to be used for decoding
Returns
Member of GUI_STRING_UNICODE_Result_t indicating decoding status
See also
gui_string_unicode_init, gui_string_unicode_encode

◆ gui_string_unicode_encode()

uint8_t gui_string_unicode_encode ( const uint32_t  c,
gui_char out 
)

Encodes input character to UNICODE sequence of 1-4 bytes.

Parameters
[in]cCharacter to encode to UNICODE sequence
[out]outPointer to 4-bytes long array to store UNICODE information to
Returns
Number of bytes required for character encoding

◆ gui_string_unicode_init()

void gui_string_unicode_init ( gui_string_unicode_t *const  s)

Initialize unicode processing structure.

Parameters
[in]sPointer to gui_string_unicode_t to initialize to default values
See also
gui_string_unicode_decode, gui_string_unicode_encode