mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
[utf8_egc_len] use MB_LEN_MAX to eliminate compile-time locale considerations
This commit is contained in:
parent
a0d37d442f
commit
4d40401344
@ -101,7 +101,7 @@ utf8_egc_len(const char* gcluster, int* colcount){
|
||||
wchar_t wc, prevw = 0;
|
||||
bool injoin = false;
|
||||
do{
|
||||
r = mbrtowc(&wc, gcluster, MB_CUR_MAX, &mbt);
|
||||
r = mbrtowc(&wc, gcluster, MB_LEN_MAX, &mbt);
|
||||
if(r < 0){
|
||||
// FIXME probably ought escape this somehow
|
||||
logerror("invalid UTF8: %s\n", gcluster);
|
||||
|
Loading…
x
Reference in New Issue
Block a user