From: Bruno Haible Date: Wed, 25 Sep 2024 20:18:31 +0000 (+0200) Subject: xgettext: Perl: Fix a bug when reading here documents in a non-UTF-8 encoding. X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=01c0f39346cf05a7c3439ba672eccbf3e560d35f;p=thirdparty%2Fgettext.git xgettext: Perl: Fix a bug when reading here documents in a non-UTF-8 encoding. * gettext-tools/src/xgettext.c (get_here_document): Update read_bytes when switching from the original encoding to the UTF-8 encoding. --- diff --git a/gettext-tools/src/x-perl.c b/gettext-tools/src/x-perl.c index 68dc3a3b1..178b54b62 100644 --- a/gettext-tools/src/x-perl.c +++ b/gettext-tools/src/x-perl.c @@ -480,6 +480,7 @@ get_here_document (struct perl_extractor *xp, const char *delimiter) my_linebuf = xrealloc (my_linebuf, my_linebuf_size); } strcpy (my_linebuf, my_line_utf8); + read_bytes = strlen (my_line_utf8); free (my_line_utf8); }