eval 'chomp($x, $y) = (1, 2);';
ok($@ =~ /Can\'t modify.*chom?p.*in.*assignment/);
-my @chars = ("N", ord('A') == 193 ? "\xee" : "\xd3", substr ("\xd4\x{100}", 0, 1), chr 1296);
+my @chars = ("N", latin1_to_native("\xd3"), substr ("\xd4\x{100}", 0, 1), chr 1296);
foreach my $start (@chars) {
foreach my $end (@chars) {
local $/ = $end;
{
my $search;
my $text;
- if (ord('A') == 193) {
- $search = "foo \x71 bar";
- $text = "a\xb1\xb1a $search $search quux";
- } else {
- $search = "foo \xc9 bar";
- $text = "a\xa3\xa3a $search $search quux";
- }
+ $search = latin1_to_native("foo \xc9 bar");
+ $text = latin1_to_native("a\xa3\xa3a $search $search quux");
my $text_utf8 = $text;
utf8::upgrade($text_utf8);
# \x{149} is LATIN SMALL LETTER N PRECEDED BY APOSTROPHE, its uppercase is
# \x{2BC}\x{E4} or MODIFIER LETTER APOSTROPHE and N.
-# In EBCDIC \x{DF} is LATIN SMALL LETTER Y WITH DIAERESIS,
-# and it's uppercase is \x{178}, LATIN CAPITAL LETTER Y WITH DIAERESIS.
-
-if (ord("A") == 193) { # EBCDIC
- is("\U\x{DF}aB\x{149}cD" , "\x{178}AB\x{2BC}NCD",
- "multicharacter uppercase");
-} elsif (ord("A") == 65) {
- is("\U\x{DF}aB\x{149}cD" , "SSAB\x{2BC}NCD",
+is(latin1_to_native("\U\x{DF}aB\x{149}cD"), latin1_to_native("SSAB\x{2BC}NCD"),
"multicharacter uppercase");
-} else {
- fail("what is your encoding?");
-}
# The \x{DF} is its own lowercase, ditto for \x{149}.
# There are no single character -> multiple characters lowercase mappings.
-if (ord("A") == 193) { # EBCDIC
- is("\LaB\x{149}cD" , "ab\x{149}cd",
+is(latin1_to_native("\L\x{DF}aB\x{149}cD"), latin1_to_native("\x{DF}ab\x{149}cd"),
"multicharacter lowercase");
-} elsif (ord("A") == 65) {
- is("\L\x{DF}aB\x{149}cD" , "\x{DF}ab\x{149}cd",
- "multicharacter lowercase");
-} else {
- fail("what is your encoding?");
-}
# titlecase is used for \u / ucfirst.
use strict;
-my $str;
-
-if (ord('A') == 193) {
- $str = join "", map chr($_), 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D, 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61, 0xF0 .. 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F, 0x7C, 0xC1 .. 0xC9, 0xD1 .. 0xD9, 0xE2 .. 0xE9, 0xAD, 0xE0, 0xBD, 0x5F, 0x6D, 0x79, 0x81 .. 0x89, 0x91 .. 0x96; # IBM-1047
-} else {
- $str = join "", map chr($_), 0x20 .. 0x6F;
-}
+my $str = join "", map latin1_to_native(chr($_)), 0x20 .. 0x6F;
# make sure it finds built-in class
is(($str =~ /(\p{Letter}+)/)[0], 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');