杂散 /377 在 xcode
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11025320/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Stray /377 in xcode
提问by gordonfreeman
I'm using xcode to do some c++ programming and all of a sudden I am receiving a "Stray /377 in program error"
我正在使用 xcode 进行一些 C++ 编程,突然间我收到“程序错误中的 Stray /377”
I think is possibly because I recently started using a non apple wireless keyboard and I possibly put in some kind of weird key combination that created a non visible key.
我想可能是因为我最近开始使用非苹果无线键盘,并且我可能放入了某种奇怪的组合键,从而创建了一个不可见的键。
I tried changing the encoding of the .cpp file to utf 8 but then when I reopen the file in xcode it comes out in chinese?
我尝试将 .cpp 文件的编码更改为 utf 8,但是当我在 xcode 中重新打开文件时,它以中文出现?
My project is very large so its not feasible to post the code for the project.
我的项目非常大,因此发布该项目的代码是不可行的。
I'm using xcode 3.2.6 on osx 10.6.8
我在 osx 10.6.8 上使用 xcode 3.2.6
I tried opening the project in xcode 3.1.6 and got the same error.
我尝试在 xcode 3.1.6 中打开项目并得到相同的错误。
回答by paulsm4
"377" is octal for "255", or an 8-bit "-1".
“377”是“255”的八进制,或 8 位“-1”。
Do you have one of those anywhere?
你在任何地方都有其中之一吗?
I believe XCode has a hex editor: just look for "0xff" somewhere in your recent source changes.
我相信 XCode 有一个十六进制编辑器:只需在最近的源代码更改中查找“0xff”即可。
回答by sarnold
Octal 377
is decimal 255
. It has no meaning in UTF-8, means a "latin small letter y with diaeresis" in ISO-8859-1. I think its presence in the file is probably a sign that it does not belong and can be removed without further consequences. If you agree, you can try removing all them in your entire tree like this:
八进制377
是十进制255
。它在 UTF-8 中没有意义,在 ISO-8859-1 中表示“带分音符的拉丁小写字母 y”。我认为它在文件中的存在可能表明它不属于它,可以将其删除而不会产生进一步的后果。如果您同意,您可以尝试删除整个树中的所有它们,如下所示:
find . -name '*.cpp' -exec sed -i~ 's/\o377//g' {} \;
The -i~
asks sed
to make a backup copy of the files that it changes, in case you need the originals back -- or want to compare the changes with diff(1)
.
的-i~
要求sed
,使它改变了文件的备份副本,以备需要将原稿-或者想比较的变化diff(1)
。