You can detect OPTU-8 with the following code:

#include <wchar.h>
#ifndef MB_LEN_MAX
#define MB_LEN_MAX 8
#endif

int
main(void)
{
        char buf[MB_LEN_MAX > 8 ? MB_LEN_MAX : 8];
        if (wcrtomb(buf, 0xEF80, NULL) != 1)
                return (1);
        return ((*((unsigned char *)buf) == 0x80) ? 0 : 1);
}

Since it’s a programme on its own and doesn’t call setlocale,
chances it’ll return 0 on non-MirBSD are minimal.

HTH,
//mirabilos
-- 
> emacs als auch vi zum Kotzen finde (joe rules) und pine für den einzig
> bedienbaren textmode-mailclient halte (und ich hab sie alle ausprobiert). ;)
Hallooooo, ich bin der Holger ("Hallo Holger!"), und ich bin ebenfalls
... pine-User, und das auch noch gewohnheitsmäßig ("Oooooooohhh").  [aus dasr]

Reply via email to