This is the mail archive of the glibc-bugs@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/1124] iconv incorrectly converts cp1255


------- 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]