[utf8_egc_len] use MB_LEN_MAX to eliminate compile-time locale considerations

This commit is contained in:
nick black 2021-11-17 18:52:04 -05:00
parent a0d37d442f
commit 4d40401344

View File

@ -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);