> I just moved some working code that uses mbrtowc into a .so loaded using
> dlopen("./libtmba.so.1", RTLD_LAZY) and it's now returning -1 "Invalid or
> incomplete multibyte or wide character". I'm using glibc-2.2.5-34 on RHL
> 7.3. It does not appear to make any difference if I setlocale(LC_CTYPE,
> "en_US.utf8") from within the dlopened code. Is this a known problem or am
> I doing something wrong here?

Problem solved (sort of). I was using an 'n' limit parameter of INT_MAX.
Limiting this to 0xFFFF appears to solve the problem.

However, I just checked the POSIX documentation and couldn't find a limit
to this parameter. If I wan't to permit users of my library to specify -1
as a limit what value should I truncate this too for passing to the
mbrtowc function and friends?

Thanks,
Mike
--
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/linux-utf8/

Reply via email to