Perl:解码“乱码”统一码字符串
我正在编写一个从某个软件调用的 CGI 脚本(我无法更改)。软件提交的变量给我带来了问题,因为如果它们包含非ascii字符,它们看起来像这样:
ÿFFFFDEetta er texti meÿFFFFF0 ÿFFFFEDslenskum stÿFFFFF6fum
而不是
Þetta er texti með íslenskum stöfum
代码>.
我尝试过修改 Encode::decode
函数,但没有任何结果 - 我所做的只是改变 ÿ
的表示方式。
是的,我有点困惑。我该怎么做才能将所有 ÿFFFFDE
更改为 Þ
等,而不需要单独替换每个非 ascii 字符(这不是解决方案,因为这需要为我什至不会说的语言工作)?
I'm working on a CGI script that is called from a piece of software (that I can't change). The variables submitted by the software are giving me problems, because if they contain non-ascii characters they look like this:
ÿFFFFDEetta er texti meÿFFFFF0 ÿFFFFEDslenskum stÿFFFFF6fum
instead of
Þetta er texti með íslenskum stöfum
.
I've tried messing with the Encode::decode
function but nothing has come of it - all I've gotten it to do is change how the ÿ
gets represented.
So yeah, I'm kind of stumped. What do I do to change all the ÿFFFFDE
s into Þ
s and so on, without resorting to replacing each non-ascii character individually (which is not a solution because this needs to work for languages I don't even speak)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)