php-翻译“%C3%BC";到 [英] php - translating "%C3%BC" to ü
问题描述
在页面中,我有以下引用:
In a page, I have this reference:
<a href="Schulte_Einf%C3%BChrung.pdf">Page</a>
我编写了一个函数来查看所引用的文件是否存在.但是在这种情况下,文件名为
I've written a function to see if the file that is referenced to exists. But in this case, the file is named
Schulte_Einführung.pdf
我知道C3 BC是ü的UTF-8编码,但是如何解码%C3%BC
并将其转换为ü?所有常见的功能,例如utf_decode
等,什么都不做.
I know that C3 BC is the UTF-8 encoding of ü, but how can I decode %C3%BC
and turn it into ü? All the usual functions like utf_decode
and so on don't do anything.
我无法更改文件名(因为我是从备份文件中提取文件名的),并且我也无法更改编码,因为这会导致页面中断.那么有没有办法比较Schulte_Einf%C3%BChrung.pdf
和Schulte_Einführung.pdf
以便它们相等?
I can't change the filename (because I pull it from a backup file), and I also can't change the encoding because then the page could break. So is there a way to compare Schulte_Einf%C3%BChrung.pdf
and Schulte_Einführung.pdf
so that they will be equal?
推荐答案
我知道C3 BC是ü的UTF-8编码
I know that C3 BC is the UTF-8 encoding of ü
不是.这是UTF-8编码的ASCII描述.
It isn't. It is an ASCII description of the UTF-8 encoding.
由于它是用URL编码的数据,因此请使用 urldecode
函数.
Since it is data encoded in a URL, use the urldecode
function.
这篇关于php-翻译“%C3%BC";到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!