Reset converter state after second wchar_t output (Bug 25734)
commitc580e6466d6da8262820cdbad19f32c5546226cf
authorCarlos O'Donell <carlos@redhat.com>
Fri, 27 Mar 2020 21:03:36 +0000 (27 17:03 -0400)
committerCarlos O'Donell <carlos@redhat.com>
Thu, 16 Apr 2020 02:31:40 +0000 (15 22:31 -0400)
tree99e73b8ab0eab515886cf4ce378be54873f5a494
parent70dfcd9b6c6fab492380a33b79e99cb9f9f438e9
Reset converter state after second wchar_t output (Bug 25734)

An input BIG5-HKSCS character may be converted into at most 2 wchar_t
characters. After outputting the second whcar_t character (which was
saved in the converter state) we must reset the state. If we fail
to reset the state we will be stuck continually copying that
character to the output even if we have further input to consider.

We add a new test case that covers the 4 BIG5-HKSCS characters
that may become 2 wchar_t characters.

Reviewed-by: Tom Honermann <tom@honermann.net>
iconvdata/Makefile
iconvdata/big5hkscs.c
iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c [new file with mode: 0644]