[patch] libstdc++/64797 fix handling of incomplete multibyte characters

Jonathan Wakely jwakely@redhat.com
Thu Mar 5 13:36:00 GMT 2015


On 04/03/15 17:20 +0000, Jonathan Wakely wrote:
>To fix the non-portable 22_locale/conversions/string/2.cc test I
>changed it to use char16_t and char32_t where I can reliably create an
>invalid sequence that causes a conversion error. That revealed some
>more problems in the Unicode conversion utilities, fixed by this patch
>and verified by the new tests.
>
>Most of the changes in codecvt.cc are just defining convenience
>constants and inline functions, but there are some minor bugs fixed in
>UTF-16 error handling too.

[...]
>    	* testsuite/22_locale/conversions/string/2.cc: Use char16_t and
>    	char32_t instead of wchar_t.
>    	* testsuite/22_locale/conversions/string/3.cc: New.

I changed the 22_locale/conversions/string/2.cc and
22_locale/conversions/string/3.cc tests to use UTF-8 as well as UTF-16
and UTF-32 and that revealed another problem in wstring_convert: I
wasn't handling the noconv case. Fixed by this patch.

Tested x86_64-linux, committed to trunk.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 4435 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20150305/fd71fde6/attachment.bin>


More information about the Libstdc++ mailing list