【发布时间】:2015-05-27 13:06:25
【问题描述】:
我有这样的字符串:“Film-DVD \x{bb}Once / The Swell Season (Collector's Edition\x{ab} John Carney" 这是 Data::Dumper 的结果。
现在我希望将十六进制值 \x{bb}、\x{ab} 替换为相应的字符 » 和 «。
我已经试过了:
$a =~ s/\\x\{(.{2})\}/chr(hex($1))/eg;
但这让我回到了“电影-DVD “Once / The Swell Season (Collector's Edition - John Carney”)
你有什么想法吗?
【问题讨论】:
-
你设置输出编码了吗?