title: RE error: illegal byte sequence on Mac OS X
body: <p>I'm trying to replace a string in a Makefile on Mac OS X for cross-compiling to iOS. The string has embedded double quotes. The command is:</p>
  
  <pre><code>sed -i "" 's|"iphoneos-cross","llvm-gcc:-O3|"iphoneos-cross","clang:-Os|g' Configure
  </code></pre>
  
  <p>And the error is:</p>
  
  <pre><code>sed: RE error: illegal byte sequence
  </code></pre>
  
  <p>I've tried escaping the double quotes, commas, dashes, and colons with no joy. For example:</p>
  
  <pre><code>sed -i "" 's|\"iphoneos-cross\"\,\"llvm-gcc\:\-O3|\"iphoneos-cross\"\,\"clang\:\-Os|g' Configure
  </code></pre>
  
  <p>I'm having a heck of a time debugging the issue. Does anyone know how to get <code>sed</code> to print the position of the illegal byte sequence? Or does anyone know what the illegal byte sequence is?</p>