2 Answers

  1. Fred- Reply

    2019-11-16

    You have UTF-8 decoded as latin-1, so the solution is to encode as latin-1 then decode as UTF-8.

    >>> s = u'\xc3\xa9cosyst\xc3\xa8mes'
    >>> s.encode('latin-1').decode('utf-8')
    u'\xe9cosyst\xe8mes'
    >>> print s.encode('latin-1').decode('utf-8')
    écosystèmes
    
  2. Gabriel- Reply

    2019-11-16

    I think this will help: bytes(u'\xc3\xa9cosyst\xc3\xa8mes', 'latin-1').decode('utf-8')

Leave a Reply

Your email address will not be published. Required fields are marked *

You can use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>