[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gnu-libiconv] Skipping over EILSEQ & EINVAL errors?
From: |
address@hidden |
Subject: |
Re: [bug-gnu-libiconv] Skipping over EILSEQ & EINVAL errors? |
Date: |
Tue, 16 Sep 2008 07:00:52 -0400 |
User-agent: |
Icedove 1.5.0.14eol (X11/20080724) |
Bruno Haible wrote:
> But the gnulib module 'striconveh' [3] contains portable code for error
> handling with iconv. It supports three error handlers:
>
> /* Handling of unconvertible characters. */
> enum iconv_ilseq_handler
> {
> iconveh_error, /* return and set errno = EILSEQ */
> iconveh_question_mark, /* use one '?' per unconvertible character */
> iconveh_escape_sequence /* use escape sequence \uxxxx or \Uxxxxxxxx */
> };
Thanks very much for pointing this out.
> Yes, this error handling can be tricky. In particular, skipping just 1 byte
> in UTF-16 or UTF-32 encoded input is probably a bad idea.
Right; I tried skipping pairs of bytes, then four bytes at a time, etc.,
but there is no consistency to how long and where in the stream these
types of errors occur.