Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Some groundwork for Unicode in Zle



    Hi Peter :)

 * Peter Stephenson <pws@xxxxxxx> dixit:
> I'm still not sure how to test whether a multibyte
> string is invalid rather than incomplete.

    AFAIK, mbrtowc returns -1 for invalid and -2 for incomplete (and
a 0 for the NULL widechar). Although the return value is 'size_t' is
nearly impossible for the function to return (size_t) -1 (or -2) for
a *correct* conversion in UTF-8. I think there is a safe bet to
assume that even an ill-formed operating system not honoring C99 will
have SIZE_MAX greater than 8 XDDDDD

    I haven't used myself the restartable set of multibyte functions,
so please take a look at SUS, POSIX or whatever to see the gory
details for this function. I've used SUS for reference.
 
    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.dervishd.net & http://www.pleyades.net/
It's my PC and I'll cry if I want to...



Messages sorted by: Reverse Date, Date, Thread, Author