Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 taking refuge in the Monastery: (18)
As of 2015-07-30 13:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls