From 01c0f39346cf05a7c3439ba672eccbf3e560d35f Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 25 Sep 2024 22:18:31 +0200 Subject: [PATCH] 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. --- gettext-tools/src/x-perl.c | 1 + 1 file changed, 1 insertion(+) 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); } -- 2.47.2