By removing invalid chars, see http://www.w3.org/TR/xml/#charsets
Handle conversion errors properly by inserting � instead. Add a binary header to provide portable way to write binary literals (I like them) Also add a test file. ref #2404