Daiki Ueno <u...@gnu.org> writes: > 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?
No, sorry, the above snippet was wrong. In the original test code, there is no reset of STATE before the mbrtowc call and it is already shifted. So, Solaris 11's mbrtowc seems broken here as well.