Microchip® Advanced Software Framework

unicode.c File Reference
#include "compiler.h"
#include "unicode.h"

Functions

uint8_t unicode_header_get (uint8_t *header, uint8_t txt_format)
 Return the header corresponding at text format identifier. More...
 
uint8_t unicode_header_scan (uint8_t *header)
 Detect the text format via a header (3 bytes) More...
 
uint8_t utf8_to_unicode (uint8_t *utf8, uint16_t *unicode)
 Conversion UTF-8 to unicode. More...
 

uint8_t unicode_header_get ( uint8_t *  header,
uint8_t  txt_format 
)

Return the header corresponding at text format identifier.

Parameters
txt_formatUNI_TYPE_UTF8, UNI_TYPE_UTF16BE, UNI_TYPE_UTF16LE, UNI_TYPE_ASCII
headerheader to fill (array of 3B)
Returns
the size of header

References UNI_TYPE_UTF16BE, UNI_TYPE_UTF16LE, and UNI_TYPE_UTF8.

Referenced by reader_txt_beg(), and reader_txt_new().

uint8_t unicode_header_scan ( uint8_t *  header)

Detect the text format via a header (3 bytes)

Parameters
headerheader to analyze (array of 3B)
Returns
text format identifier

References UNI_TYPE_ASCII, UNI_TYPE_UTF16BE, UNI_TYPE_UTF16LE, and UNI_TYPE_UTF8.

Referenced by reader_txt_beg().

uint8_t utf8_to_unicode ( uint8_t *  utf8,
uint16_t *  unicode 
)

Conversion UTF-8 to unicode.

Parameters
utf8array with utf8 codes (array of 3B max)
unicodepointer used to store the character unicode decoded
Returns
the size of UTF8 decoded

References c0, c1, and c2.

Referenced by reader_txt_get_line().