in reply to tr/// not working for replacment of curly quotes
use utf8 ?
You should dump your string to see what's inside, best inspected with Devel::Peek
Tested on my mobile
$ perl use utf8; $string = "cant"; $string =~ tr//"'"/; print $string . "\n"; __END__ "can't" $
Without utf8 Perl is considering every string to be a byte string not a character string (the flag will be missing)
Your multibyte unicode character might look ok in your editor but Perl will try to transliterate individual bytes.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: tr/// not working for replacment of curly quotes
by nysus (Parson) on Jul 26, 2020 at 21:30 UTC | |
by LanX (Saint) on Jul 26, 2020 at 21:35 UTC | |
by jcb (Parson) on Jul 27, 2020 at 03:10 UTC |