This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Notes on why PathTools is in Cwd/
[perl5.git] / Porting / regcharclass.pl
index 7f97ca3..2d90039 100644 (file)
@@ -8,13 +8,13 @@ use Data::Dumper;
 $Data::Dumper::Useqq= 1;
 our $hex_fmt= "0x%02X";
 
-=head1 TITLE
+=head1 NAME
 
 CharClass::Matcher -- Generate C macros that match character classes efficiently
 
 =head1 SYNOPSIS
 
-  ~/perl$ perl Porting\regcharclass.pl
+    perl Porting/regcharclass.pl
 
 =head1 DESCRIPTION
 
@@ -133,7 +133,9 @@ sub __uni_latin1 {
 
         my $copy= $str;    # must copy string, FB_CROAK makes encode destructive
         $u= eval { Encode::encode( "utf8", $copy, Encode::FB_CROAK ) };
-        $u= [ unpack "U0C*", $u ] if $u;
+        # $u is utf8 but with the utf8 flag OFF
+        # therefore "C*" gets us the values of the bytes involved.
+        $u= [ unpack "C*", $u ] if defined $u;
     }
     return ( \@cp, $n, $l, $u );
 }
@@ -252,6 +254,8 @@ sub new {
         my ( $cp, $low, $latin1, $utf8 )= __uni_latin1( $str );
         my $UTF8= $low   || $utf8;
         my $LATIN1= $low || $latin1;
+        #die Dumper($txt,$cp,$low,$latin1,$utf8)
+        #    if $txt=~/NEL/ or $utf8 and @$utf8>3;
 
         @{ $self->{strs}{$str} }{qw( str txt low utf8 latin1 cp UTF8 LATIN1 )}=
           ( $str, $txt, $low, $utf8, $latin1, $cp, $UTF8, $LATIN1 );
@@ -641,8 +645,9 @@ if ( !caller ) {
  *
  * !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
  * This file is built by Porting/$zero.
- * (Generated at: @{[ scalar gmtime ]} GMT)
+ * 
  * Any changes made here will be lost!
+ *
  */
 
 HEADER