source: trunk/essentials/dev-lang/perl/t/op/utf8decode.t@ 3315

Last change on this file since 3315 was 3181, checked in by bird, 19 years ago

perl 5.8.8

File size: 8.9 KB
Line 
1#!./perl
2
3BEGIN {
4 chdir 't' if -d 't';
5 @INC = '../lib';
6}
7
8{
9 my $wide = v256;
10 use bytes;
11 my $ordwide = ord($wide);
12 printf "# under use bytes ord(v256) = 0x%02x\n", $ordwide;
13 if ($ordwide == 140) {
14 print "1..0 # Skip: UTF-EBCDIC (not UTF-8) used here\n";
15 exit 0;
16 }
17 elsif ($ordwide != 196) {
18 printf "# v256 starts with 0x%02x\n", $ordwide;
19 }
20}
21
22no utf8;
23
24print "1..78\n";
25
26my $test = 1;
27
28# This table is based on Markus Kuhn's UTF-8 Decode Stress Tester,
29# http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt,
30# version dated 2000-09-02.
31
32# We use the \x notation instead of raw binary bytes for \x00-\x1f\x7f-\xff
33# because e.g. many patch programs have issues with binary data.