Stray /377 in xcode

I’m using xcode to do some c++ programming and all of a sudden I am receiving a “Stray /377 in program error”

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.

  • Xcode std::cout output acting odd
  • Calling `print` inside NSView opens print dialog
  • Read a file/URL line-by-line in Swift
  • How to add buttons when NSVisualEffectView is used
  • Library for decoding a zip file in chunk
  • What is 'llvm-gcc-4.2' doing in '/usr' on my Yosemite system?
  • 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?

    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

    I tried opening the project in xcode 3.1.6 and got the same error.

    2 Solutions Collect From Internet About “Stray /377 in xcode”

    “377” is octal for “255”, or an 8-bit “-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.

    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:

    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).