unichar.h revision 2a7605bb97dc9ed8accf2537fad1073a5fc5ff48
#ifndef __UNICHAR_H
#define __UNICHAR_H
extern const uint8_t *const uni_utf8_non1_bytes;
/* Returns number of characters in a NUL-terminated unicode string */
/* Translates UTF-8 input to UCS-4 output. Returns 0 if ok, -1 if input was
invalid */
/* Translates UCS-4 input to UTF-8 output. */
/* Returns 1 if *chr_r is set, 0 for incomplete trailing character,
-1 for invalid input. */
/* Returns UTF-8 string length with maximum input size. */
/* Returns the number of bytes belonging to this partial UTF-8 character.
Invalid input is returned with length 1. */
static inline unsigned int uni_utf8_char_bytes(char chr)
{
/* 0x00 .. 0x7f are ASCII. 0x80 .. 0xC1 are invalid. */
return 1;
}
#endif