Subject: | Should correctly flush states |
While converting Japanese text from EUC-JP to ISO-2022-JP I found out that Text:Iconv doesn't generates the correct escape sequences at the end of the converted text needed in ISO-2022-JP.
I studied the code of iconv(1) that seems to handle this correct and
prepared the attached patch. It seems to work well (but I doesn't
tested it that much).
Gruesse,
Frank Lichtenheld
(using Text::Iconv 1.2 with Perl 5.6.1 on Debian GNU/Linux)
--- libtext-iconv-perl-1.2/Iconv.xs Sat Aug 11 12:10:04 2001
+++ libtext-iconv-perl-1.2.new/Iconv.xs Thu Jan 29 01:31:20 2004
@@ -125,6 +125,10 @@
return(&PL_sv_undef);
}
}
+
+ /* Flush the state for state-dependent character sets */
+ (void) iconv(iconv_handle, NULL, NULL,
+ &ocursor, &outbytesleft);
}
/* Copy the converted bytes to the return string, and free the