mirror of
https://github.com/fluencelabs/musl
synced 2025-07-01 23:52:02 +00:00
byte-based C locale, phase 3: make MB_CUR_MAX variable to activate code
this patch activates the new byte-based C locale (high bytes treated as abstract code unit "characters" rather than decoded as multibyte characters) by making the value of MB_CUR_MAX depend on the active locale. for the C locale, the LC_CTYPE category pointer is null, yielding a value of 1. all other locales yield a value of 4.
This commit is contained in:
@ -34,4 +34,7 @@ const char *__lctrans_cur(const char *);
|
||||
|
||||
#define CURRENT_UTF8 (!!__pthread_self()->locale->cat[LC_CTYPE])
|
||||
|
||||
#undef MB_CUR_MAX
|
||||
#define MB_CUR_MAX (CURRENT_UTF8 ? 4 : 1)
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user