Skip to content

utf8 metadata not displayed properly #19

Description

@pitrou

I'm trying out the xifr extension so I choose a news article at random since they often come with illustrations.

On https://www.letelegramme.fr/ille-et-vilaine/rennes-35000/accuse-davoir-empeche-lexpulsion-de-lattaquant-darras-manuel-valls-repond-6448696.php , the metadata of the main article photo displays like this:

xifr

The unexpected characters in the description are a symptom of utf8-encoded text being displayed as if it were in another character set (such as latin-1 / iso-8859-1).

For example, "Défense" is exactly what you get when you take the word "Défense", encode it as utf8, and then decode it as latin1. See Python snippet:

>>> "Défense".encode('utf8')
b'D\xc3\xa9fense'
>>> "Défense".encode('utf8').decode("latin1")
'Défense'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions