From a35d4ce9ccb3eb5903df3d221fdfd9a0d1fb5c37 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Fri, 21 Jun 2019 17:36:59 -0400 Subject: Fix bounds error in utf16_to_utf8 conversion --- libtests/qutil.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libtests/qutil.cc') diff --git a/libtests/qutil.cc b/libtests/qutil.cc index 900f0e6f..a5c44fc5 100644 --- a/libtests/qutil.cc +++ b/libtests/qutil.cc @@ -238,6 +238,10 @@ void to_utf16_test() print_utf16(0xdeadUL); print_utf16(0x7fffffffUL); print_utf16(0x80000000UL); + + std::string s(QUtil::utf8_to_utf16("\xcf\x80")); + std::cout << QUtil::utf16_to_utf8(s) << std::endl; + std::cout << QUtil::utf16_to_utf8(s + ".") << std::endl; } void utf8_to_ascii_test() -- cgit v1.2.3-54-g00ecf