Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Decoding, Encoding string, how to? (internal encoding)

by ikegami (Pope)
on Apr 03, 2009 at 01:34 UTC ( #755158=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    +-----------------------------------------------------------------+
    |                                                                 |
    ...
    |  +--------------------+     upgrade     +--------------------+  |
    |                                                                 |
    +-----------------------------------------------------------------+
    
  2. or download this
    use Encode qw(is_utf8 encode decode);
    binmode STDOUT,':encoding(iso-8859-1)';
    my $str = "This's a \x{201c}test\x{201d}";  # This is a "decoded" str.
    print "$utf8\n";                            # Encoded by :encoding
    
  3. or download this
    use Encode qw(is_utf8 encode decode);
    my $str = "This's a \x{201c}test\x{201d}";  # This is a "decoded" str.
    print encode('iso-8859-1', "$utf8\n");      # Include the LF.
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://755158]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2014-08-23 14:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (174 votes), past polls