title: Python decoding issue with Chinese characters
body: <p>I'm using Python 3.5, and I'm trying to take a block of byte text that may or may not contain special Chinese characters and output it to a file.  It works for entries that do not contain Chinese characters, but breaks when they do. The Chinese characters are always a person's name, and are always in addition to the English spelling of their name. The text is JSON formatted and needs to be decoded before I can load it. The decoding seems to go fine and doesn't give me any errors.  When I try and write the decoded text to a file it gives me the following error message: </p>
  
  <blockquote>
    <p>UnicodeEncodeError: 'charmap' codec can't encode characters in position 14-18: character maps to undefined</p>
  </blockquote>
  
  <p>Here is an example of the raw data that I get before I do anything to it:</p>
  
  <pre><code> b'  "isBulkRecipient": "false",\r\n      "name": "Name in, English \xef'
   b'\xab\x62\xb6\xe2\x15\x8a\x8b\x8a\xee\xab\x89\xcf\xbc\x8a",\r\n
  </code></pre>
  
  <p>Here is the code that I am using:</p>
  
  <pre><code>recipientData = json.loads(recipientContent.decode('utf-8', 'ignore'))
  recipientName = recipientData['signers'][0]['name']
  pprint(recipientName)
  with open('envelope recipient list.csv', 'a', newline='') as fp:
      a = csv.writer(fp, delimiter=',')
      csvData = [[recipientName]]
      a.writerows(csvData)
  </code></pre>
  
  <p>The <code>recipientContent</code> is obtained from an API call. I do not need to have the Chinese characters in the output file.  Any advice will be greatly appreciated!</p>
  
  <p>Update:</p>
  
  <p>I've been doing some manual workarounds for each entry that breaks, and came other entries that didn't contain Chinese special characters, but had them from other languages, and the broke the program as well.  The special characters are only in the name field.  So a name could be something like "Ałex" where it is a mixture of normal and special characters.  Before i decode the string that contains this information i am able to print it out to the screen and it looks like this: <code>b'name": "A\xc5ex",\r\n</code></p>
  
  <p>But after i decode it into utf-8 it will give me an error if i try to output it.  The error message is: <code>UnicodeEncodeError: 'charmap' codec can't encode character 'u0142' in position 2- character maps to -undefined-</code></p>
  
  <p>I looked up what \u0142 was and it is the ł special character.</p>