title: Python Skip/Delete Non-Decodable Characters
body: <p>I'm currently converting some customer-entered strings as part of a json. I've already made a dict out of the strings, and now am just doing:</p>
  
  <pre><code>json.dumps(some_dict)
  </code></pre>
  
  <p>Problem is, for some of the customer entered data, it seems they've somehow entered garbled stuff and trying to dump to json breaks the whole thing:</p>
  
  <pre><code>{'FIRST_NAME': 'sdffg\xed', 'LAST_NAME': 'sdfsadf'}
  </code></pre>
  
  <p>Which then gets me:</p>
  
  <pre><code>UnicodeDecodeError: 'ascii' codec can't decode byte 0xed in position 6: ordinal not in range(128)
  </code></pre>
  
  <p>I have no control over where the data comes from, so I can't prevent this upfront. So, now that this bad data already exists, I was thinking of just replacing unknown/bad characters with some placeholder character, or deleting them. How can I do this?</p>