[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mbrtowc test fails on Solaris 11
From: |
Daiki Ueno |
Subject: |
Re: mbrtowc test fails on Solaris 11 |
Date: |
Thu, 02 Oct 2014 19:17:45 +0900 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) |
Daiki Ueno <address@hidden> 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.