PHP中的奇怪角色错误? [英] Wierd character bug in PHP?

查看:83
本文介绍了PHP中的奇怪角色错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天发现一个有趣的。我一直在

办公室编辑一些代码和我的编辑之一,Coda,SubEthaEdit,Scite或Geany

在我的PHP源文件中添加了一个有趣的字符。


最初我认为这是我代码中某个地方的错误。但在我将其视为phps文件之前,我并没有知道这个隐藏的角色。

http://projects.mike-martin.com/fecking_bug.phps
http://projects.mike-martin.com/fecking_bug.php.txt
http://projects.mike-martin.com/fecking_bug.php - 错误返回
http://projects.mike -martin.com/fecking_bug.php.gz - 如果txt

文件不包含该字符。


任何人都可以还是用我刚给出的链接重现它?


我希望Apache不要让它消失。现在我必须回到

到我的所有代码中,看看它是否已经悄悄进入。我尝试转换/

重新解释行结尾和编码类型 - 甚至是Coda中的ASCII

但它仍然出现!


我知道这可能是一个编码问题,但肯定是这样的一个

不应该让PHP失败吗?


Mike

解决方案

.. oO(Michael J Martin)


>今天发现一个有趣的。我已经在
办公室编辑了一些代码,其中一位编辑,Coda,SubEthaEdit,Scite或Geany
在我的PHP源文件中添加了一个有趣的字符。
最初我认为这是我代码中某个地方的错误。但在我将其视为phps文件之前,我并没有知道这个隐藏的角色。

http://projects.mike-martin.com/fecking_bug.phps
http://projects.mike-martin.com/fecking_bug.php.txt
http://projects.mike-martin.com/fecking_bug.php - 错误返回
http://projects.mike-martin.com /fecking_bug.php.gz - 如果txt
文件不包含该字符。

其他人可以使用我刚刚给出的链接重现它吗?



是的。问题是它来自哪里?


>我希望Apache不会让它消失。现在我必须回到我的所有代码中,看看它是否已经悄悄进入。我尝试转换/
重新解释行结尾和编码类型 - 甚至是Coda中的ASCII 但它仍然出现!

我知道它可能是一个编码问题但是肯定这样的一个
不应该让PHP失败吗?



所讨论的字节是0x7F,即DEL。控制字符:

http ://www.fileformat.info/info/unic...007f/index.htm


显然它根本就不应该存在。


Micha


Michael J Martin写道:


发现一个有趣的今天。我一直在

办公室编辑一些代码和我的编辑之一,Coda,SubEthaEdit,Scite或Geany

在我的PHP源文件中添加了一个有趣的字符。


最初我认为这是我代码中某个地方的错误。但在我将其视为phps文件之前,我并没有知道这个隐藏的角色。

http://projects.mike-martin.com/fecking_bug.phps
http://projects.mike-martin.com/fecking_bug.php.txt
http://projects.mike-martin.com/fecking_bug.php - 错误返回
http://projects.mike -martin.com/fecking_bug.php.gz - 如果txt

文件不包含该字符。


任何人都可以还是用我刚给出的链接重现它?


我希望Apache不要让它消失。现在我必须回到

到我的所有代码中,看看它是否已经悄悄进入。我尝试转换/

重新解释行结尾和编码类型 - 甚至是Coda中的ASCII

但它仍然出现!


我知道这可能是一个编码问题,但肯定是这样的一个

不应该让PHP失败吗?


Mike



Mike,


它位于你的.gz文件中 - 在


qsql =和

echo语句之间的一行上。


也许尝试不同的编辑器。它在TextPad中完美呈现。


-

==================
删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================


Found an interesting one today. I''ve been editing some code in the
office and one of my editors, either Coda, SubEthaEdit, Scite or Geany
added an interesting character into my PHP source file.

Initially I thought it was a bug somewhere in my code. But I didn''t
know about this hidden character until I viewed it as a phps file.

http://projects.mike-martin.com/fecking_bug.phps
http://projects.mike-martin.com/fecking_bug.php.txt
http://projects.mike-martin.com/fecking_bug.php - error it returns
http://projects.mike-martin.com/fecking_bug.php.gz - in case the txt
file doesn''t contain the character.

Can anyone else reproduce it with the links I have just given?

I''m hoping Apache doesn''t cause it to go away. Now I''ve got to go back
into all my code to see if it''s crept in. I tried converting /
reinterpreting Line Endings and Encoding types - even to ASCII in Coda
but it still appears!

I know it''s probably an encoding issue but surely one like this
shouldn''t bring PHP down?

Mike

解决方案

..oO(Michael J Martin)

>Found an interesting one today. I''ve been editing some code in the
office and one of my editors, either Coda, SubEthaEdit, Scite or Geany
added an interesting character into my PHP source file.

Initially I thought it was a bug somewhere in my code. But I didn''t
know about this hidden character until I viewed it as a phps file.

http://projects.mike-martin.com/fecking_bug.phps
http://projects.mike-martin.com/fecking_bug.php.txt
http://projects.mike-martin.com/fecking_bug.php - error it returns
http://projects.mike-martin.com/fecking_bug.php.gz - in case the txt
file doesn''t contain the character.

Can anyone else reproduce it with the links I have just given?

Yes. Question is where does it come from?

>I''m hoping Apache doesn''t cause it to go away. Now I''ve got to go back
into all my code to see if it''s crept in. I tried converting /
reinterpreting Line Endings and Encoding types - even to ASCII in Coda
but it still appears!

I know it''s probably an encoding issue but surely one like this
shouldn''t bring PHP down?

The byte in question is 0x7F, which is the "DEL" control char:

http://www.fileformat.info/info/unic...007f/index.htm

Obviously it shouldn''t be there at all.

Micha


Michael J Martin wrote:

Found an interesting one today. I''ve been editing some code in the
office and one of my editors, either Coda, SubEthaEdit, Scite or Geany
added an interesting character into my PHP source file.

Initially I thought it was a bug somewhere in my code. But I didn''t
know about this hidden character until I viewed it as a phps file.

http://projects.mike-martin.com/fecking_bug.phps
http://projects.mike-martin.com/fecking_bug.php.txt
http://projects.mike-martin.com/fecking_bug.php - error it returns
http://projects.mike-martin.com/fecking_bug.php.gz - in case the txt
file doesn''t contain the character.

Can anyone else reproduce it with the links I have just given?

I''m hoping Apache doesn''t cause it to go away. Now I''ve got to go back
into all my code to see if it''s crept in. I tried converting /
reinterpreting Line Endings and Encoding types - even to ASCII in Coda
but it still appears!

I know it''s probably an encoding issue but surely one like this
shouldn''t bring PHP down?

Mike

Mike,

It is in your .gz file - on a line by itself between the


qsql= and the
echo statements.

Maybe try a different editor. It showed up perfectly in TextPad.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


这篇关于PHP中的奇怪角色错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆