Help for this page

Select Code to Download


  1. or download this
    use Encode;
    ...
    $x = chr(65533);
    $y = Encode::encode('utf-8', $x); # -> "\x{aa}\x{42}\x{fe}"
    
  2. or download this
    $y = Encode::decode('some encoding', $x);
    binmode STDOUT, ":bytes"; print $x;
    ...
    
  3. or download this
    $y = Encode::encode('some encoding', $x);
    $n = rindex($x, "\N{WHITE SMILEY FACE}"); # need: use charnames ':full
    +';
    ...