<<< Date Index >>>     <<< Thread Index >>>

Re: display of CP-1258



Alain Bench wrote:
> > What happens inside the iconv() function is that when the "oe"
> > character is read, it is stored in the state, for possible combination
> > with a following accent. Then the "u" character is read. Since it is
> > not an accent, the "oe" is scheduled for output, and since ISO-8859-1
> > doesn't contain this character, it is now that EILSEQ is returned.
>
>     Wouldn't it be possible to temporarily unread the innocent 'u' char
> when iconv() sees it doesn't combine with stored state, so before '½'
> output and possible EILSEQ return?

I don't think that's how iconv() is supposed to work.

>     But Edmund's test program gives me a strange:
> | test("M\xE9illeurs", "windows-1258", "ISO-8859-1");
> | Converting from windows-1258 to ISO-8859-1
> | iconv returned 0
> | Read 9 bytes and wrote 8 bytes
> | Méilleurs » Méilleur
>
>     With 1 last byte unwritten and uncounted?

That's because he hasn't called iconv(cd,NULL,NULL,&ob,&obl) at the end.

Bruno