note
choroba
You can use the <c>\x</c> notation in a regex:
<c>
s/\xe2\x80\x99/'/g
</c><P>
If you want to use it in a one-liner, you need to be careful about quoting. In bash, for example, you need to write
<c>
perl -pe 's/\xe2\x80\x99/'\''/g' file
</c><P>
or use the <c>\x</c> for the single quote, as well:
<c>
perl -pe 's/\xe2\x80\x99/\x27/g' file
</c><P>
Alternatively, if you want to use "smart quote" directly:
<pre>
use utf8;
open my $in, '<:encoding(UTF-8)', 'file' or die $!;
while (<$in>) {
s/’/'/g;
print;
}
</pre><P>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-832495">
<c>map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]</c>
</div></div><!-- Wiki2Monks {"version":1.161} -->
11138555
11138555