runtime now looks at the SVf_UTF8 bit on the SV to decide
[p5sagit/p5-mst-13.2.git] / t / pragma / warn / utf8
1
2   utf8.c AOK
3
4      [utf8_to_uv]
5      Malformed UTF-8 character
6         my $a = ord "\x80" ;
7
8      Malformed UTF-8 character
9         my $a = ord "\xf080" ;
10      <<<<<< this warning can't be easily triggered from perl anymore
11
12      [utf16_to_utf8]
13      Malformed UTF-16 surrogate         
14      <<<<<< Add a test when somethig actually calls utf16_to_utf8
15
16 __END__
17 # utf8.c [utf8_to_uv]
18 use utf8 ;
19 my $a = ord "\x80" ;
20 EXPECT
21 ########
22 # utf8.c [utf8_to_uv]
23 BEGIN {
24     if (ord("\t") == 5) {
25         print "SKIPPED\n# Ebcdic platforms have different \\x constructs.";
26         exit 0;
27     }
28 }
29 use utf8 ;
30 my $a = ord "\x80" ;
31 {
32     use warnings 'utf8' ;
33     my $a = ord "\x80" ;
34     no warnings 'utf8' ;
35     my $a = ord "\x80" ;
36 }
37 EXPECT
38 \x80 will produce malformed UTF-8 character; use \x{80} for that at - line 12.
39 ########
40 # utf8.c [utf8_to_uv]
41 use utf8 ;
42 my $a = ord "\xf080" ;
43 EXPECT
44 ########
45 # utf8.c [utf8_to_uv]
46 BEGIN {
47     if (ord("\t") == 5) {
48         print "SKIPPED\n# Ebcdic platforms have different \\x constructs.";
49         exit 0;
50     }
51 }
52 use utf8 ;
53 my $a = ord "\xf080" ;
54 {
55     use warnings 'utf8' ;
56     my $a = ord "\xf080" ;
57     no warnings 'utf8' ;
58     my $a = ord "\xf080" ;
59 }
60 EXPECT
61 \xf0 will produce malformed UTF-8 character; use \x{f0} for that at - line 12.