NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/47602 (getwc() modifies input instead of returning EILSEQ.)

> On Jan 21, 12:29am, (YAMAMOTO Takashi) wrote:
> -- Subject: Re: lib/47602 (getwc() modifies input instead of returning EILSEQ
> | my question was about the test program in this PR, not t_io.
> The program expects to be able to read the data it wrote to the file.
> I.e. if you getwc() from a file, the character you read should match
> the sequence of bytes you read. This assumes that there is a 1<->1 mapping
> from wchar_t to wint_t. Isn't that true?

do you mean to expect the "c == obuf[i]" test always true?

you should read the same byte sequences but wchar_t values corresponding
to the byte sequence is locale dependent.

while obuf[] is wchar_t for big5 locale (right?), what getwc returns
is wchar_t for another locale.  comparing them with "==" doesn't make
much sense.

(i'm not sure about the intention of the mixed use of getwc and getc
in the program, though.)


> christos

Home | Main Index | Thread Index | Old Index