Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/270.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 这是什么编码?_Php_Encoding - Fatal编程技术网

Php 这是什么编码?

Php 这是什么编码?,php,encoding,Php,Encoding,如何确定此字符串的编码方式 Sometimes, it’s the little things that make us the happiest. 它是UTF-8,解码为拉丁语-1,编码为UTF-8,解码为CP1252 >>> u'’'.encode('cp1252').decode('utf8').encode('latin1').decode('utf8') u'\u2019' 说真的。。。这是谁干的?你到底是怎么弄明白的?而且,它有一个印刷右引号

如何确定此字符串的编码方式

Sometimes, it’s the little things that make us the happiest.

它是UTF-8,解码为拉丁语-1,编码为UTF-8,解码为CP1252

>>> u'’'.encode('cp1252').decode('utf8').encode('latin1').decode('utf8')
u'\u2019'

说真的。。。这是谁干的?

你到底是怎么弄明白的?而且,它有一个印刷右引号,而不是一个明显应该是撇号的地方。@Lèse--UTF-8双重编码有一个商标:大量出现在U+00C0到U+00C3范围内的字符(各种重音大写字母a)因为128-255字符的UTF-8编码从0xc0到0xc3开始:)@hobbs:啊,现在我知道该注意什么了。我总是看到编码不好的网页,但我无法通过更改编码使其中一些网页在我的浏览器中正确呈现。可能是双重/三重编码。@Webnet:我必须使用2个
iconv()
调用,一个从UTF-8调用CP1252,另一个从UTF-8调用ISO8859-1。