unicode: add UCS4 constants
Four helpers that define maximum UCS4 values, invalid values and a replacement character for unknown values. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
parent
c1075fba18
commit
468e265138
@ -465,7 +465,7 @@ int tsm_utf8_mach_feed(struct tsm_utf8_mach *mach, char ci)
|
||||
uint32_t tsm_utf8_mach_get(struct tsm_utf8_mach *mach)
|
||||
{
|
||||
if (!mach || mach->state != TSM_UTF8_ACCEPT)
|
||||
return KMSCON_UCS4_INVALID;
|
||||
return TSM_UCS4_REPLACEMENT;
|
||||
|
||||
return mach->ch;
|
||||
}
|
||||
|
@ -51,6 +51,10 @@
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define TSM_UCS4_MAX (0x7fffffffUL)
|
||||
#define TSM_UCS4_INVALID (TSM_UCS4_MAX + 1)
|
||||
#define TSM_UCS4_REPLACEMENT (0xfffdUL)
|
||||
|
||||
/* symbols */
|
||||
|
||||
typedef uint32_t kmscon_symbol_t;
|
||||
|
Loading…
x
Reference in New Issue
Block a user