在mac上使用eclipse,我得到随机隐形字符\160。为什么? [英] Using eclipse on mac, I get random invisible character \160 . why?
问题描述
我在我的mac上使用eclipse,我随机获得字符\160(无论是什么),而不是代码中的空白。
I'm using eclipse on my mac and I randomly get character \160 (whatever that is) instead of a white space in my code.
到编译的时候我得到
java:74:非法字符:\160
java:74: illegal character: \160
if =='*'||?c =='/')
if (c == '*' ||?c == '/')
我的代码在eclipse中读取
where my code reads in eclipse
if(c =='*'|| c =='/')
if (c == '*' || c == '/')
这只是烦人,通常通过删除假设的不可见来解决?并在编辑器中再次按空格键。
This is just annoying and usually resolved by deleting the supposed invisible ? and pressing spacebar once again in the editor.
我很好奇为什么会发生这种情况,如果有人有一个想法。
I'm curious as to why this happens if anybody has an idea.
推荐答案
as @Hanynowsky提到它与您复制的源和文件中的一个不同的编码。我没有找到任何办法自动删除伪造的不匹配字符,但你可以看到他们在eclipse如果你启用编辑器显示空格。
as @Hanynowsky mention it is related to a different encoding between the source you copied and the one from your file. I have not found any way to automatically removed the bogus mismatching characters, but you can actually see them in eclipse if you enable the editor to show whitespaces.
为此:
- 将Eclipse设置为显示空格字符(首选项 - >常规 - >编辑器 - >文本编辑器) b $ b
- 伪造的\160字符将显示为。即使您的其他空间将显示为。。所以你只需要删除。发生,你是好的!
这篇关于在mac上使用eclipse,我得到随机隐形字符\160。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!