From: Jarkko Hietaniemi Date: Wed, 6 Feb 2002 15:02:20 +0000 (+0000) Subject: EBCDIC: the encoding pragma would need some rethinking, X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0effba8c71e3da7d9cf86c7baa2d721067b4761d;p=p5sagit%2Fp5-mst-13.2.git EBCDIC: the encoding pragma would need some rethinking, probably a pass of EBCDIC->Unicode mapping. For now, disable it on EBCDIC. p4raw-id: //depot/perl@14572 --- diff --git a/lib/encoding.pm b/lib/encoding.pm index 642726d..1504a92 100644 --- a/lib/encoding.pm +++ b/lib/encoding.pm @@ -4,6 +4,13 @@ our $VERSION = '1.00'; use Encode; +BEGIN { + if (ord("A") == 193) { + require Carp; + Carp::croak "encoding pragma does not support EBCDIC platforms"; + } +} + sub import { my ($class, $name) = @_; $name = $ENV{PERL_ENCODING} if @_ < 2; @@ -94,6 +101,8 @@ For native multibyte encodings (either fixed or variable length) the current implementation of the regular expressions may introduce recoding errors for longer regular expression literals than 127 bytes. +The encoding pragma is not supported on EBCDIC platforms. + =head1 SEE ALSO L, L diff --git a/lib/encoding.t b/lib/encoding.t index 8b14c88..d61c4f6 100644 --- a/lib/encoding.t +++ b/lib/encoding.t @@ -1,5 +1,11 @@ print "1..19\n"; +BEGIN { + if (ord("A") == 193) { + print "1..0 # encoding pragma does not support EBCDIC platforms\n"; + } +} + use encoding "latin1"; # ignored (overwritten by the next line) use encoding "greek"; # iso 8859-7 (no "latin" alias, surprise...)