Convert invalid strings from binary to utf-8

Since changing the encoding from UTF8 to UTF8 doesn't do anything (see
http://bugs.ruby-lang.org/issues/7967#note-1), change the source encoding
to binary (ie. ascii-8bit) and replace all undefined characters.