From: Jarkko Hietaniemi Date: Sun, 18 May 2003 06:23:50 +0000 (+0000) Subject: UTF-7 tweak from Dan Kogai. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=842a5aa6cf6dc6d87ec0a6a5e7fb7beb1541aa70;p=p5sagit%2Fp5-mst-13.2.git UTF-7 tweak from Dan Kogai. p4raw-id: //depot/perl@19550 --- diff --git a/ext/Encode/lib/Encode/Unicode/UTF7.pm b/ext/Encode/lib/Encode/Unicode/UTF7.pm index c3bcd3b..bb1a79e 100644 --- a/ext/Encode/lib/Encode/Unicode/UTF7.pm +++ b/ext/Encode/lib/Encode/Unicode/UTF7.pm @@ -15,13 +15,13 @@ use Encode; # our $OPTIONAL_DIRECT_CHARS = 1; -my $specials = quotemeta "\'(),-.:?"; +my $specials = quotemeta "\'(),-./:?"; $OPTIONAL_DIRECT_CHARS and $specials .= quotemeta "!\"#$%&*;<=>@[]^_`{|}"; # \s will not work because it matches U+3000 DEOGRAPHIC SPACE -# We use \x00-\x20 instead (controls + space) -my $re_asis = qr/(?:[\x00-\x20A-Za-z0-9$specials])/; -my $re_encoded = qr/(?:[^\x00-\x20A-Za-z0-9$specials])/; +# We use qr/[\n\r\t\ ] instead +my $re_asis = qr/(?:[\n\r\t\ A-Za-z0-9$specials])/; +my $re_encoded = qr/(?:[^\n\r\t\ A-Za-z0-9$specials])/; my $e_utf16 = find_encoding("UTF-16BE"); sub needs_lines { 1 };