我发现很多问题接近于此,但没有任何帮助我解决它的问题。由于我缺乏专业知识,这是个问题。
PHP有html_entity_decode
这可能有所帮助,但Perl没有,我相信。
在我的MySQL数据库中,我在' "
12' 6"
个跟随长度
我希望它显示为12'6“。
我试过了:
$string =~ s/:[']:/'/g;
$string =~ s/:["]:/"/g;
$string =~ s/'/'/g;
$string =~ s/"/"/g;
$string =~ s/\'/'/g;
$string =~ s/\"/"/g;
$string =~ s/\'/\'/g;
$string =~ s/\"/\"/g;
perl -pi -e 's:':':g' $_; #crashes.
perl -pi -e 's:":":g' $string #also crashes.
system -pi -e 's:':':g' $_; #crashes.
system -pi -e 's:":":g' $string #also crashes.
我不知所措。有人可以帮忙吗?
答案 0 :(得分:6)
use warnings;
use strict;
use HTML::Entities;
my $str = '12' 6"';
print decode_entities($str);