diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-02-08 08:34:49 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-02-08 08:34:49 +0000 |
commit | a091d647ce76165cfbaaa70cd4c206bdc3c5401f (patch) | |
tree | d397fc955bc535aa5c5e31ea8c6c504b429b1f64 /ext | |
parent | 1604a5406b7adf0a94a6c9490c526da20d71e4c3 (diff) | |
parent | 0f963d18b45f22cda3029bf090e5d41f52f4ab8b (diff) | |
download | perl-a091d647ce76165cfbaaa70cd4c206bdc3c5401f.tar.gz |
Integrate mainline
p4raw-id: //depot/perlio@14594
Diffstat (limited to 'ext')
-rw-r--r-- | ext/Encode/Encode.xs | 2 | ||||
-rw-r--r-- | ext/Encode/Makefile.PL | 6 | ||||
-rw-r--r-- | ext/Unicode/Normalize/t/norm.t | 47 | ||||
-rw-r--r-- | ext/Unicode/Normalize/t/test.t | 55 |
4 files changed, 95 insertions, 15 deletions
diff --git a/ext/Encode/Encode.xs b/ext/Encode/Encode.xs index 52fee5a676..83417a55a2 100644 --- a/ext/Encode/Encode.xs +++ b/ext/Encode/Encode.xs @@ -255,7 +255,7 @@ PerlIOEncode_fill(pTHX_ PerlIO * f) (The copy is a pain - need a put-it-here option for decode.) */ sv_setpvn(e->bufsv,s,len); - e->base.ptr = e->base.buf = (U8*)SvPVX(e->bufsv); + e->base.ptr = e->base.buf = (STDCHAR*)SvPVX(e->bufsv); e->base.end = e->base.ptr + SvCUR(e->bufsv); PerlIOBase(f)->flags |= PERLIO_F_RDBUF; SvUTF8_on(e->bufsv); diff --git a/ext/Encode/Makefile.PL b/ext/Encode/Makefile.PL index d6db7795e9..042225c382 100644 --- a/ext/Encode/Makefile.PL +++ b/ext/Encode/Makefile.PL @@ -93,7 +93,11 @@ sub postamble $continuator = ''; } } - $str .= "\n\t\$(PERL) compile -O -o \$\@ -f $table.fnm\n\n"; + if ($^O eq 'VMS' ) { # quote to preserve case + $str .= qq{\n\t\$(PERL) compile -"O" -o \$\@ -f $table.fnm\n\n}; + } else { + $str .= qq{\n\t\$(PERL) compile -O -o \$\@ -f $table.fnm\n\n}; + } open (FILELIST, ">$table.fnm") || die "Could not open $table.fnm: $!"; foreach my $file (@{$tables{$table}}) diff --git a/ext/Unicode/Normalize/t/norm.t b/ext/Unicode/Normalize/t/norm.t index 970e6712f7..b75b295617 100644 --- a/ext/Unicode/Normalize/t/norm.t +++ b/ext/Unicode/Normalize/t/norm.t @@ -24,9 +24,24 @@ sub hexNFD { unpack 'U*', normalize 'NFD', pack 'U*', map hex(), split ' ', shift; } -ok(hexNFC("0061 0315 0300 05AE 05C4 0062"), "00E0 05AE 05C4 0315 0062"); -ok(hexNFC("00E0 05AE 05C4 0315 0062"), "00E0 05AE 05C4 0315 0062"); -ok(hexNFC("0061 05AE 0300 05C4 0315 0062"), "00E0 05AE 05C4 0315 0062"); +my $ordA = ord("A"); +my $ASCII = $ordA == 0x41; +my $EBCDIC = $ordA == 0xc1; + +if ($ASCII) { + ok(hexNFC("0061 0315 0300 05AE 05C4 0062"), "00E0 05AE 05C4 0315 0062"); + ok(hexNFC("00E0 05AE 05C4 0315 0062"), "00E0 05AE 05C4 0315 0062"); + ok(hexNFC("0061 05AE 0300 05C4 0315 0062"), "00E0 05AE 05C4 0315 0062"); +} elsif ($EBCDIC) { + # A WITH GRAVE is 0044 in EBCDIC, not 00E0 + # SMALL LATIN B is 0082 in EBCDIC, not 0062 + ok(hexNFC("0061 0315 0300 05AE 05C4 0062"), "0044 05AE 05C4 0315 0082"); + ok(hexNFC("00E0 05AE 05C4 0315 0062"), "0044 05AE 05C4 0315 0082"); + ok(hexNFC("0061 05AE 0300 05C4 0315 0062"), "0044 05AE 05C4 0315 0082"); +} else { + skip("Neither ASCII nor EBCDIC based") for 1..3; +} + ok(hexNFC("0045 0304 0300 AC00 11A8"), "1E14 AC01"); ok(hexNFC("1100 1161 1100 1173 11AF"), "AC00 AE00"); ok(hexNFC("1100 0300 1161 1173 11AF"), "1100 0300 1161 1173 11AF"); @@ -34,10 +49,30 @@ ok(hexNFC("1100 0300 1161 1173 11AF"), "1100 0300 1161 1173 11AF"); ok(hexNFD("0061 0315 0300 05AE 05C4 0062"), "0061 05AE 0300 05C4 0315 0062"); ok(hexNFD("00E0 05AE 05C4 0315 0062"), "0061 05AE 0300 05C4 0315 0062"); ok(hexNFD("0061 05AE 0300 05C4 0315 0062"), "0061 05AE 0300 05C4 0315 0062"); -ok(hexNFC("0061 05C4 0315 0300 05AE 0062"), "0061 05AE 05C4 0300 0315 0062"); -ok(hexNFC("0061 05AE 05C4 0300 0315 0062"), "0061 05AE 05C4 0300 0315 0062"); + +if ($ASCII) { + ok(hexNFC("0061 05C4 0315 0300 05AE 0062"), "0061 05AE 05C4 0300 0315 0062"); + ok(hexNFC("0061 05AE 05C4 0300 0315 0062"), "0061 05AE 05C4 0300 0315 0062"); +} elsif ($EBCDIC) { + # SMALL LATIN A is 0081 in EBCDIC, not 0061 + # SMALL LATIN B is 0082 in EBCDIC, not 0062 + ok(hexNFC("0061 05C4 0315 0300 05AE 0062"), "0081 05AE 05C4 0300 0315 0082"); + ok(hexNFC("0061 05AE 05C4 0300 0315 0062"), "0081 05AE 05C4 0300 0315 0082"); +} else { + skip("Neither ASCII nor EBCDIC based") for 1..2; +} + ok(hexNFD("0061 05C4 0315 0300 05AE 0062"), "0061 05AE 05C4 0300 0315 0062"); ok(hexNFD("0061 05AE 05C4 0300 0315 0062"), "0061 05AE 05C4 0300 0315 0062"); -ok(hexNFC("0000 0041 0000 0000"), "0000 0041 0000 0000"); + +if ($ASCII) { + ok(hexNFC("0000 0041 0000 0000"), "0000 0041 0000 0000"); +} elsif ($EBCDIC) { + # CAPITAL LATIN A is 00C1 in EBCDIC, not 0041 + ok(hexNFC("0000 0041 0000 0000"), "0000 00C1 0000 0000"); +} else { + skip("Neither ASCII nor EBCDIC based"); +} + ok(hexNFD("0000 0041 0000 0000"), "0000 0041 0000 0000"); diff --git a/ext/Unicode/Normalize/t/test.t b/ext/Unicode/Normalize/t/test.t index 6c3e7acac1..d02bcc0304 100644 --- a/ext/Unicode/Normalize/t/test.t +++ b/ext/Unicode/Normalize/t/test.t @@ -24,9 +24,24 @@ sub hexNFD { unpack 'U*', NFD pack 'U*', map hex(), split ' ', shift; } -ok(hexNFC("0061 0315 0300 05AE 05C4 0062"), "00E0 05AE 05C4 0315 0062"); -ok(hexNFC("00E0 05AE 05C4 0315 0062"), "00E0 05AE 05C4 0315 0062"); -ok(hexNFC("0061 05AE 0300 05C4 0315 0062"), "00E0 05AE 05C4 0315 0062"); +my $ordA = ord("A"); +my $ASCII = $ordA == 0x41; +my $EBCDIC = $ordA == 0xc1; + +if ($ASCII) { + ok(hexNFC("0061 0315 0300 05AE 05C4 0062"), "00E0 05AE 05C4 0315 0062"); + ok(hexNFC("00E0 05AE 05C4 0315 0062"), "00E0 05AE 05C4 0315 0062"); + ok(hexNFC("0061 05AE 0300 05C4 0315 0062"), "00E0 05AE 05C4 0315 0062"); +} elsif ($EBCDIC) { + # A WITH GRAVE is 0044 in EBCDIC, not 00E0 + # SMALL LATIN B is 0082 in EBCDIC, not 0062 + ok(hexNFC("0061 0315 0300 05AE 05C4 0062"), "0044 05AE 05C4 0315 0082"); + ok(hexNFC("00E0 05AE 05C4 0315 0062"), "0044 05AE 05C4 0315 0082"); + ok(hexNFC("0061 05AE 0300 05C4 0315 0062"), "0044 05AE 05C4 0315 0082"); +} else { + skip("Neither ASCII nor EBCDIC based") for 1..3; +} + ok(hexNFC("0045 0304 0300 AC00 11A8"), "1E14 AC01"); ok(hexNFC("1100 1161 1100 1173 11AF"), "AC00 AE00"); ok(hexNFC("1100 0300 1161 1173 11AF"), "1100 0300 1161 1173 11AF"); @@ -34,13 +49,39 @@ ok(hexNFC("1100 0300 1161 1173 11AF"), "1100 0300 1161 1173 11AF"); ok(hexNFD("0061 0315 0300 05AE 05C4 0062"), "0061 05AE 0300 05C4 0315 0062"); ok(hexNFD("00E0 05AE 05C4 0315 0062"), "0061 05AE 0300 05C4 0315 0062"); ok(hexNFD("0061 05AE 0300 05C4 0315 0062"), "0061 05AE 0300 05C4 0315 0062"); -ok(hexNFC("0061 05C4 0315 0300 05AE 0062"), "0061 05AE 05C4 0300 0315 0062"); -ok(hexNFC("0061 05AE 05C4 0300 0315 0062"), "0061 05AE 05C4 0300 0315 0062"); + +if ($ASCII) { + ok(hexNFC("0061 05C4 0315 0300 05AE 0062"), "0061 05AE 05C4 0300 0315 0062"); + ok(hexNFC("0061 05AE 05C4 0300 0315 0062"), "0061 05AE 05C4 0300 0315 0062"); +} elsif ($EBCDIC) { + # SMALL LATIN A is 0081 in EBCDIC, not 0061 + # SMALL LATIN B is 0082 in EBCDIC, not 0062 + ok(hexNFC("0061 05C4 0315 0300 05AE 0062"), "0081 05AE 05C4 0300 0315 0082"); + ok(hexNFC("0061 05AE 05C4 0300 0315 0062"), "0081 05AE 05C4 0300 0315 0082"); +} else { + skip("Neither ASCII nor EBCDIC based") for 1..2; +} + ok(hexNFD("0061 05C4 0315 0300 05AE 0062"), "0061 05AE 05C4 0300 0315 0062"); ok(hexNFD("0061 05AE 05C4 0300 0315 0062"), "0061 05AE 05C4 0300 0315 0062"); -ok(hexNFC("0000 0041 0000 0000"), "0000 0041 0000 0000"); + +if ($ASCII) { + ok(hexNFC("0000 0041 0000 0000"), "0000 0041 0000 0000"); +} elsif ($EBCDIC) { + # CAPITAL LATIN A is 00C1 in EBCDIC, not 0041 + ok(hexNFC("0000 0041 0000 0000"), "0000 00C1 0000 0000"); +} else { + skip("Neither ASCII nor EBCDIC based"); +} + ok(hexNFD("0000 0041 0000 0000"), "0000 0041 0000 0000"); # should be unary. -ok(NFC "\x{41}\x{0302}\x{0301}\x62" eq "\x{1EA4}\x62"); +if ($ASCII) { + ok(NFC "\x{41}\x{0302}\x{0301}\x62" eq "\x{1EA4}\x62"); +} elsif ($EBCDIC) { + ok(NFC "\x{41}\x{0302}\x{0301}\x62" eq "\x{1EA4}\x82"); +} else { + skip("Neither ASCII nor EBCDIC based"); +} ok(NFD "\x{E0}\x{AC00}" eq "\x{61}\x{0300}\x{1100}\x{1161}"); |