Hello, On Solaris 11, a couple of mbrtowc tests fails:
FAIL: test-mbrtowc3.sh ====================== test-mbrtowc.c:116: assertion 'wc == (wchar_t) 0xBADFACE' failed FAIL: test-mbrtowc4.sh ====================== test-mbrtowc.c:303: assertion 'ret == 1' failed The former case checks if the WC value is unchanged around the call: memset (&state, 0, sizeof (mbstate_t)); mbrtowc (&wc, NULL, 7, &state); As the Solaris manual page[1] states that PWC and N are ignored if S is NULL, it seems like a bug in the system mbrtowc. The latter case checks if the return value of mbrtowc, when scanning a string starting with "\271\201", under the zh_CN.GB18030 locale. char input[] = "B\250\271\201\060\211\070er"; memset (&state, '\0', sizeof (mbstate_t)); wc = (wchar_t) 0xBADFACE; ret = mbrtowc (&wc, input + 2, 7, &state); ASSERT (ret == 1); However, "\271\201" is a valid GB18030 sequence which encodes U+7B92. Maybe it should expect ret == 2? Footnotes: [1] http://docs.oracle.com/cd/E36784_01/html/E36874/mbrtowc-3c.html Regards, -- Daiki Ueno