2

我正在运行 ubuntu 13.04 64bit,使用 sublime text 2 编写 PHP。我有时似乎收到以下错误:

Parse error: syntax error, unexpected 'Â ' (T_STRING) in
/home/afflicto/public_html/html/HTML.php on line 10

它是通过删除整行并重新编写来解决的。该字符在源代码中不可见。

这是怎么回事?这只发生在ubuntu上,从来没有发生在windows上。
提前致谢。

4

1 回答 1

0

可能发生的情况是您在按空格键(ALT+空格键)的同时按住 alt 键,进入一个不间断空格而不是常规空格。我不是 100% 确定 Ubuntu,但这是 OSX 中的一个常见问题。

要在 Sublime Text 中修复它,请将以下内容添加到 Preferences/Key Bindings - User:

{ "keys": ["alt+space"], "command": "insert_snippet", "args": {"contents": " " } },

请注意,如果文件中有其他行,则需要保留尾随,- 否则将其删除。

在下面阅读更多内容:

https://superuser.com/questions/78245/how-to-disable-the-option-space-key-combination-for-non-break-spaces

于 2014-10-09T07:48:14.417 回答