[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using iconv in stand-alone info
From: |
Eli Zaretskii |
Subject: |
Re: Using iconv in stand-alone info |
Date: |
Wed, 23 Dec 2015 20:23:41 +0200 |
> Date: Wed, 23 Dec 2015 20:19:13 +0200
> From: Eli Zaretskii <address@hidden>
> Cc: address@hidden
>
> > > @@ -918,7 +920,13 @@ copy_converting (long n)
> > > iconv_ret = iconv (iconv_to_utf8, &inptr, &bytes_left,
> > > &utf8_char_ptr, &utf8_char_free);
> > > /* If we managed to write a character: */
> > > - if (utf8_char_ptr > utf8_char) break;
> > > + if (utf8_char_ptr > utf8_char)
> > > + {
> > > + if (iconv_ret == (size_t) -1)
> > > + iconv_ret = iconv (iconv_to_utf8, NULL, NULL,
> > > + &utf8_char_ptr, &utf8_char_free);
> > > + break;
> > > + }
> > > }
> > >
> > > /* errno == E2BIG if iconv ran out of output buffer,
> >
> > If it's true that iconv will delay writing to the output buffer until
> > it sees the next character in case it is a combining character, then
> > it's possible that this condition will never be satisfied.
>
> No, not AFAIK. 'iconv' only returns a value different from -1 when it
> finished processing all the input. By calling it with NULL arguments,
> you force it to output what it's got. Which means that even a
> combining character will be output -- as itself.
Ignore that, I wasn't thinking clearly.
Yes, you are right, I think I should change the logic there. Will
resubmit.
- Using iconv in stand-alone info, Eli Zaretskii, 2015/12/21
- Re: Using iconv in stand-alone info, Gavin Smith, 2015/12/21
- Re: Using iconv in stand-alone info, Eli Zaretskii, 2015/12/21
- Re: Using iconv in stand-alone info, Gavin Smith, 2015/12/21
- Re: Using iconv in stand-alone info, Eli Zaretskii, 2015/12/23
- Re: Using iconv in stand-alone info, Gavin Smith, 2015/12/23
- Re: Using iconv in stand-alone info, Eli Zaretskii, 2015/12/23
- Re: Using iconv in stand-alone info,
Eli Zaretskii <=
- Re: Using iconv in stand-alone info, Eli Zaretskii, 2015/12/23
- Re: Using iconv in stand-alone info, Gavin Smith, 2015/12/23
- Re: Using iconv in stand-alone info, Eli Zaretskii, 2015/12/24
- Re: Using iconv in stand-alone info, Gavin Smith, 2015/12/24
- Re: Using iconv in stand-alone info, Eli Zaretskii, 2015/12/24
- Re: Using iconv in stand-alone info, Gavin Smith, 2015/12/24
- Re: Using iconv in stand-alone info, Gavin Smith, 2015/12/27
- Re: Using iconv in stand-alone info, Gavin Smith, 2015/12/24
- Re: Using iconv in stand-alone info, Eli Zaretskii, 2015/12/25
- Re: Using iconv in stand-alone info, Gavin Smith, 2015/12/25