public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bruno at clisp dot org" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug locale/19418] iconv should stop reading from 'inbuf' when 'outbytesleft' is zero
Date: Sat, 18 Feb 2023 23:09:49 +0000	[thread overview]
Message-ID: <bug-19418-131-WhcXEV6TbN@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-19418-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=19418

Bruno Haible <bruno at clisp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bruno at clisp dot org

--- Comment #3 from Bruno Haible <bruno at clisp dot org> ---
(In reply to Andreas Schwab from comment #2)
> It is impossible in general to know how much space is needed in *outbuf
> before reading the next bytes from *inbuf.

Right. In particular some bytes from the input may be dropped from the output.
See:

$ printf 'x\U000E0004' | iconv -f UTF-8 -t UCS-2BE | od -t x1
0000000 00 78
0000002

It produces the same output as

$ printf 'x' | iconv -f UTF-8 -t UCS-2BE | od -t x1
0000000 00 78
0000002

-- 
You are receiving this mail because:
You are on the CC list for the bug.

           reply	other threads:[~2023-02-18 23:09 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <bug-19418-131@http.sourceware.org/bugzilla/>]

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=bug-19418-131-WhcXEV6TbN@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /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).