Help for this page

Select Code to Download


  1. or download this
        while(my $uchar = $us->chop) {
            my $utf8 = $uchar->utf8;
            $rslt = (($utf8 =~ /[\x80-\xff]/) ? '\\u'.unpack('H4', $uchar-
    +>utf16be) : $utf8) . $rslt;
        }
    
  2. or download this
        while(my $uchar = $us->substr( $offset++, 1 )) {
            my $utf8 = $uchar->utf8;
            $rslt .= ($utf8 =~ /[\x80-\xff]/) ? '\\u'.unpack('H4', $uchar-
    +>utf16be) : $utf8;
        }
    
  3. or download this
    # This does what Unicode::Escape::escape does, except a lot less.
    # It assumes the input is utf8 encoded.
    ...
    
        return $s;
    }
    
  4. or download this
    use strict;
    use warnings;
    ...
        # puke a lot of unintelligible yuck.
        ok( $canonical eq $test, "correct escaping for '$t->{name}'" );
    }
    
  5. or download this
    use strict;
    use warnings;
    ...
        print "*** $txt->[1]\n";
        cmpthese( -30, $subs );
    }
    
  6. or download this
    sub utf8_escape_2 {
        my $s = shift;
    ...
    
        return $s;
    }