[英]can't decode a urlencoded utf-8 string
Here's the string: 这是字符串:
%d0%91%d0%b5%d0%b7
I think it's cyrillic and I need it converted to something readable. 我认为这是西里尔字母,需要将其转换为可读的东西。
mb_detect_encoding()
states it's ASCII. mb_detect_encoding()
说明它是ASCII。
When I do iconv('ASCII', 'UTF-8', $str)
, it shows me the same string. 当我执行
iconv('ASCII', 'UTF-8', $str)
,它向我显示了相同的字符串。
Judging by this article , looks like it's in UTF-8, but how do I decode that into readable UTF? 从本文看来,它看起来像是UTF-8,但是如何将其解码为可读的UTF?
Please help 请帮忙
UPDATE the following site was able to decode the text: http://2cyr.com/decode/?lang=en (thanks to Faiz Rasool for pointing out). 更新以下站点能够解码文本: http : //2cyr.com/decode/?lang=cn (感谢Faiz Rasool指出)。 The preset I used there is
source=utf-8; postfilter=urlencoded
我在那里使用的预设是
source=utf-8; postfilter=urlencoded
source=utf-8; postfilter=urlencoded
, but I've no idea how to reproduce that on my server. source=utf-8; postfilter=urlencoded
,但是我不知道如何在服务器上重现它。
This string look like url encoded try this. 此字符串看起来像经过url编码的尝试此操作。
<?php
$str = "%d0%91%d0%b5%d0%b7";
echo utf8_encode(urldecode($str));
?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.