[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gnu-libiconv] Skipping over EILSEQ & EINVAL errors?
From: |
address@hidden |
Subject: |
[bug-gnu-libiconv] Skipping over EILSEQ & EINVAL errors? |
Date: |
Mon, 15 Sep 2008 18:45:12 -0400 |
User-agent: |
Icedove 1.5.0.14eol (X11/20080724) |
Can anyone explain why the iconv binary can successfully skip over bad
characters in the input (EILSEQ & EINVAL errors), but the libiconv
conversion function cannot?
I've been trying to use libiconv to convert CJK files into UTF-8.
I've noticed that when I run something like this (using the iconv
binary, from a command line):
/usr/bin/iconv -f gb2312 [chinese language file encoded as gb2312]
I may get a warning about an "illegal input sequence", but regardless,
iconv can move beyond it, and complete the rest of the file.
But in using libiconv, there seems to be no way around this.
In the code example
(http://www.gnu.org/software/libc/manual/html_node/iconv-Examples.html),
hitting an EILSEQ or EINVAL error is cause for stopping processing.
In my own code, I've tried to lseek forward if I get either of those
errors, but the iconv function gives no indication of how large the bad
input is, or where the next "clean" byte is.
Is there anything else I can do?
- [bug-gnu-libiconv] Skipping over EILSEQ & EINVAL errors?,
address@hidden <=