diff --git a/src/unicode.c b/src/unicode.c index 3bd59ca..376e700 100644 --- a/src/unicode.c +++ b/src/unicode.c @@ -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; } diff --git a/src/unicode.h b/src/unicode.h index 5a69710..3b69e64 100644 --- a/src/unicode.h +++ b/src/unicode.h @@ -51,6 +51,10 @@ #include #include +#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;