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

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

by ikegami (Patriarch)
on Apr 03, 2009 at 01:34 UTC ( [id://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 "$str\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', "$str\n");
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-03-29 10:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found