summaryrefslogtreecommitdiff
path: root/t/pragma/warn/doop
blob: d66695049502136aec24f22879d2923284c64519 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  doop.c	AOK

  Malformed UTF-8 character


__END__
# doop.c
use utf8 ;
$_ = "\x80  \xff" ;
chop ;
EXPECT
Malformed UTF-8 character at - line 4.
########
# doop.c
BEGIN {
    if (ord("\t") == 5) {
        print "SKIPPED\n# Character codes differ on ebcdic machines.";
        exit 0;
    }
}
use warnings 'utf8'  ;
use utf8 ;
$_ = "\x80  \xff" ;
chop ;
no warnings 'utf8'  ;
$_ = "\x80  \xff" ;
chop ;
EXPECT
\x80 will produce malformed UTF-8 character; use \x{80} for that at - line 4.
\xff will produce malformed UTF-8 character; use \x{ff} for that at - line 4.
Malformed UTF-8 character at - line 5.