This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug libc/1124] iconv incorrectly converts cp1255
- From: "redhat-bugzilla at future dot shiny dot co dot il" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 31 Jul 2005 21:19:35 -0000
- Subject: [Bug libc/1124] iconv incorrectly converts cp1255
- References: <20050723195836.1124.z9u2k@bezeqint.net>
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
------- Additional Comments From redhat-bugzilla at future dot shiny dot co dot il 2005-07-31 21:19 -------
> I would advise against hiding the flush decision inside iconv() - some users
might need different flush behaviors, and forcing a single one might cause
problems in the future.
Fair enough. iconv(3) manpage doesn't provide an explicit flush method, but it
does have something with similar semantics:
A different case is when inbuf is NULL or *inbuf is NULL, but outbuf is
not NULL and *outbuf is not NULL. In this case, the iconv function
attempts to set cd?s conversion state to the initial state and store a
corresponding shift sequence at *outbuf. At most *outbytesleft bytes,
starting at *outbuf, will be written.
Except for storing a "shift sequence" (probably something related to Far-Eastern
encodings), this is just what we want to do: to reset the state.
Thus, the solution would be to mandate all iconv users to call iconv(cd, NULL,
NULL, &outbuf, &outlen) once more after they finished their conversion loop,
just to flush out remaining data.
I don't think we can add more functions to iconv at this point. iconv conforms
to certain standards which we better not extend.
--
http://sources.redhat.com/bugzilla/show_bug.cgi?id=1124
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.