Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On some pages requests detect encoding incorrectly #1150

Closed
Euphorbium opened this issue Jan 29, 2013 · 2 comments
Closed

On some pages requests detect encoding incorrectly #1150

Euphorbium opened this issue Jan 29, 2013 · 2 comments

Comments

@Euphorbium
Copy link

For example it detects http://www.15min.lt encoding as ISO-8859-1, but the encoding is set as utf8

@sigmavirus24
Copy link
Contributor

This is a duplicate of #1087. You can see there that we don't read the content to determine the encoding. If you want you can use apparent_encoding() to get an encoding from charade. You can also use from requests.utils import get_encodings_from_content, but we don't parse the HTML anymore. We simply report encoding from the Headers and if there is none, we default to ISO-8859-1.

@Lukasa
Copy link
Member

Lukasa commented Jan 29, 2013

To clarify @sigmavirus24's point, we only default to ISO-8859-1 in some cases.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants