title: Python – How do I convert an ASCII string into UTF-8?
body: <p>I am using a package in python that returns a string using ASCII characters as opposed to unicode (eg. returns 'serÃ©' as opposed to seré).</p>
  <p>Given this is python 3.8, the string is actually encoded in unicode, the package just seems to output it as if it were ASCII. As such, when I try to perform x.decode('utf-8') or x.encode('ascii'), neither work. Is there a way to make python treat the string as if it were ASCII, such that I can decode it to unicode? Or is there a package that can serve this purpose.</p>
  <p>I am relatively new to python so I apologise if my explanation is unclear. I am happy to clarify things if needed.</p>
  <h4>Code</h4>
  <pre class="lang-py prettyprint-override"><code>from spanishconjugator import Conjugator as c  
  verb = c().conjugate('pasar', 'preterite', 'indicative', 'yo')
  print(verb)  
  </code></pre>
  <p>This returns the string 'pasÃ©' where it should return 'pasé'.</p>
  <h4>Update</h4>
  <p>From further searching and from your answers, it appears to be an issue to do with single 2-byte UTF-8 (é) characters being literally interpreted as two 1-byte latin-1 (Ã©) characters (nothing to do with ASCII, my mistake).</p>
  <p>Managed to fix it with:</p>
  <pre class="lang-py prettyprint-override"><code>verb.encode('latin-1').decode('utf-8')
  </code></pre>
  <p>Thank you to those that commented.</p>