Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Replacing non ascii in string

by Athanasius (Chancellor)
on Jan 30, 2013 at 04:38 UTC ( #1015957=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    14:33 >perl -wE "my $s = 'Australia’s ‘Powder Capital’'; $s =~ tr/‘’/'
    +/; say $s;"
    Australia's 'Powder Capital'
    14:33 >
  2. or download this
    14:42 >perl -wE "my $t = 'and ... xxx said “This is a fantastic start 
    +to the season”'; $t =~ tr/“”/\"/; say $t;"
    and ... xxx said "This is a fantastic start to the season"
    14:43 >
  3. or download this
    14:46 >perl -wE "my $s = qq[Australia’s ‘Powder Capital’\nand ... xxx 
    +said “This is a fantastic start to the season”]; $s =~ tr/‘’“”/''\"\"
    +/; say $s;"
    Australia's 'Powder Capital'
    and ... xxx said "This is a fantastic start to the season"
    14:49 >

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (16)
As of 2016-10-24 19:10 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (309 votes). Check out past polls.