From dbde19516d139ef4237fc56ac1a14665a9f13c0b Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sun, 18 Oct 2009 22:01:49 +0100 Subject: utf16_to_utf8() should croak on encountering a bare low surrogate. --- ext/XS-APItest/t/utf16_to_utf8.t | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ext') diff --git a/ext/XS-APItest/t/utf16_to_utf8.t b/ext/XS-APItest/t/utf16_to_utf8.t index 3f6f798a32..5e6c58acf5 100644 --- a/ext/XS-APItest/t/utf16_to_utf8.t +++ b/ext/XS-APItest/t/utf16_to_utf8.t @@ -34,6 +34,9 @@ is($got, undef, 'hence eval returns undef'); for (["\xD8\0\0\0", 'NULs'], ["\xD8\0\xD8\0", '2 Lows'], + ["\xDC\0\0\0", 'High NUL'], + ["\xDC\0\xD8\0", 'High Low'], + ["\xDC\0\xDC\0", 'High High'], ) { my ($malformed, $name) = @$_; $got = eval {utf16_to_utf8($malformed)}; -- cgit v1.2.1