Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/pe
    1. my $smiley = "\xE2\x98\xBA";
    2. print $smiley . "\n"; 
    3. _utf8_on($smiley);
    4. print $smiley . "\n";
    
  2. or download this
    U+00E2  LATIN SMALL LETTER A WITH CIRCUMFLEX
    U+0098  START OF STRING
    U+00BA  MASCULINE ORDINAL INDICATOR
    
  3. or download this
    U+263A  WHITE SMILING FACE
    
  4. or download this
    # Explicit encode()
    use Encode qw(encode);
    ...
    # Set the filehandle to :utf8, a shortcut syntax because you need it s
    +o often
    binmode STDOUT, ":utf8";
    print $smiley
    
  5. or download this
    use utf8;
    use Socket qw(inet_aton);
    ...
    print $data_to_send;
    
    # Oops, these characters don't exist in KOI8-R, so Perl used question 
    +marks. Heehee :)
    
  6. or download this
    my Buf $byte_string;
    my Str $text_string;