in reply to Escaping or removing quotes
compare
use strict; use warnings; use Data::Dump qw/pp dd/; #use utf8; my $string = 'copied from a web page looking like this: Test. '; dd $string; $string =~ s///g; $string =~ s///g; dd $string;
without utf8 strings are an octect-stream
C:/Strawberry/perl/bin\perl.exe -w d:/tmp/pm/replace_quotes.pl "copied from a web page looking like this: \xE2\x80\x9CTest.\xE2\x80\x +9D " "copied from a web page looking like this: Test. "
with utf8 they are in the internal unicode variant
C:/Strawberry/perl/bin\perl.exe -w d:/tmp/pm/replace_quotes.pl "copied from a web page looking like this: \x{201C}Test.\x{201D} " "copied from a web page looking like this: Test. "
you need to make sure that the chars in your file (i.e. the way it's saved by your editor) and the web-input are both in the same encoding, because are not ASCII-characters.
see perlunitut
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Escaping or removing quotes
by htmanning (Friar) on Jun 17, 2021 at 23:05 UTC | |
by LanX (Saint) on Jun 17, 2021 at 23:22 UTC |