From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Bug in libiconv?
Date: Wed, 26 Jan 2011 22:39:00 -0000 [thread overview]
Message-ID: <20110126161556.GP28470@calimero.vinschen.de> (raw)
In-Reply-To: <4D402507.6030205@cwilson.fastmail.fm>
On Jan 26 08:43, Charles Wilson wrote:
> On 1/26/2011 8:26 AM, Corinna Vinschen wrote:
> > On Jan 26 13:15, simrw@sim-basis.de wrote:
> >>> Here's what happens on Cygwin:
> >>> - Even though the last parameter to iconv is defined in bytes, the
> >>> value of outbytesleft after the conversion is the number of remaining
> >>> wchar"t's, not the number of remaining bytes. That's contrary to
> >>> what POSIX defines, see
> >>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html
> >>
> >> IMHO, the count is correct.
> >> On Windows/Cygwin, wchar_t is 2 bytes, on Linux, 4 bytes.
> >> So the buffer is 512 bytes.
> >> In the first 3 cases, 10 input bytes were consumed so that there remains
> >> in the buffer (512 - 20) = 492 bytes.
> >> In the last case all 16 bytes are consumed so there remains in
> >> the buffer (512 - 32) = 480 bytes.
> >
> > Yes, you're right. Quite obviously I misinterpreted the results without
> > realizing that the buffer is smaller under Cygwin.
>
> Sure, but there ARE still bugs in libiconv on Cygwin -- specifically:
> - Even though iconv_open has been opened explicitely with "UTF-8" as
> input string, the conversion still depends on the current application
> codeset. That doesn't make sense.
> and
> - 'iconv_close ((iconv_t) -1);' crashes the application with a SEGV.
Indeed. But it was an important hint, nevertheless. It just didn't
occur to me that the buffer size is different between Cygwin and
Linux.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
next prev parent reply other threads:[~2011-01-26 16:16 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-26 13:39 simrw
2011-01-26 13:50 ` Corinna Vinschen
2011-01-26 17:01 ` Charles Wilson
2011-01-26 22:39 ` Corinna Vinschen [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-02-02 18:58 Bruno Haible
2011-02-02 21:20 ` Corinna Vinschen
2011-02-02 22:57 ` Charles Wilson
2011-01-29 2:15 Bruno Haible
2011-01-29 12:34 ` Charles Wilson
2011-01-29 13:20 ` Charles Wilson
2011-01-29 17:15 ` Corinna Vinschen
2011-01-29 16:02 ` Corinna Vinschen
2011-01-29 17:51 ` Eric Blake
2011-01-29 18:12 ` Corinna Vinschen
2011-01-29 18:28 ` Eric Blake
2011-01-30 11:34 ` Corinna Vinschen
2011-01-30 11:43 ` Corinna Vinschen
2011-01-30 2:40 ` Corinna Vinschen
2011-01-27 16:06 simrw
2011-01-25 6:36 Corinna Vinschen
2011-01-25 11:15 ` Charles Wilson
2011-01-25 15:04 ` Corinna Vinschen
2011-01-25 18:58 ` Charles Wilson
2011-01-25 20:11 ` Corinna Vinschen
2011-01-28 22:13 ` Charles Wilson
2011-01-27 5:46 ` Charles Wilson
2011-01-27 16:05 ` Corinna Vinschen
2011-01-27 17:18 ` Charles Wilson
2011-01-27 3:53 ` Charles Wilson
2011-01-27 16:21 ` Corinna Vinschen
2011-01-27 17:39 ` Charles Wilson
2011-01-27 18:05 ` Corinna Vinschen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110126161556.GP28470@calimero.vinschen.de \
--to=corinna-cygwin@cygwin.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).