title: Remove invalid UTF-8 characters from a string
body: <p>I get this on json.Marshal of a list of strings:</p>
  
  <pre><code>json: invalid UTF-8 in string: "...ole\xc5\"
  </code></pre>
  
  <p>The reason is obvious, but how can I delete/replace such strings in Go? I've been reading docst on <code>unicode</code> and <code>unicode/utf8</code> packages and there seems no obvious/quick way to do it.</p>
  
  <p>In Python for example you have methods for it where the invalid characters can be deleted, replaced by a specified character or strict setting which raises exception on invalid chars. How can I do equivalent thing in Go?</p>
  
  <p>UPDATE: I meant the reason for getting an exception (panic?) - illegal char in what json.Marshal expects to be valid UTF-8 string.</p>
  
  <p>(how the illegal byte sequence got into that string is not important, the usual way - bugs, file corruption, other programs that do not conform to unicode, etc)</p>