3 # Verify round trip of translations from the native character set to unicode
4 # and back work. If this is wrong, nothing will be reliable.
6 print "1..257\n"; # 0-255 plus one beyond
9 my $uni = utf8::native_to_unicode($i);
10 if ($uni < 0 || $uni >= 256) {
13 elsif (utf8::unicode_to_native(utf8::native_to_unicode($i)) != $i) {
17 print $i + 1 . " - native_to_unicode $i";
21 # Choose a largish number that might cause a seg fault if inappropriate array
23 if (utf8::unicode_to_native(utf8::native_to_unicode(100000)) != 100000) {
26 print "ok 257 - native_to_unicode of large number\n";