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

Unpopular encoding #268

Open
DisaPadla opened this issue Oct 19, 2024 · 8 comments · May be fixed by #269
Open

Unpopular encoding #268

DisaPadla opened this issue Oct 19, 2024 · 8 comments · May be fixed by #269
Labels

Comments

@DisaPadla
Copy link

I don't think this is critical, I just wanted to notify about it. At the moment, slowreader might incorrectly display data received from websites that use less common encodings, such as Windows-1251 or ISO-8859-1. The percentage of such websites is very small, so feel free to close the issue if it's not relevant.

@ai
Copy link
Contributor

ai commented Oct 19, 2024

Yes, good idea. We should look at HTTP headers for encoding. It is also important for Japanese users where UTF-8 is not very popular for historical reasons.

Maybe we can add some autodetect, but I am not sure that autodetect code is worst of it since most of Internet right now on UTF-8.

@DisaPadla
Copy link
Author

DisaPadla commented Oct 19, 2024

Thx for quick response. I'm not sure what do you mean under "autodetect", but for now, i don't know better solution than use arrayBuffer instead of text method. I’ve just started looking into this project, and this is the first thing that came to mind.

@ai
Copy link
Contributor

ai commented Oct 19, 2024

I'm not sure what do you mean under "autodetect"

Browsers has algorithm to detect charset by heuristics even without Content-Type header. But I think we do not need it.

BTW, are we sure, that response.text() doesn’t do charset encoding correction automatically?

@DisaPadla
Copy link
Author

I see this result for some web resources
Screenshot 2024-10-20 at 09 24 52

@ai
Copy link
Contributor

ai commented Oct 20, 2024

Can you give a link for the testing?

@DisaPadla
Copy link
Author

Example
https://www.pravda.com.ua/

@DisaPadla
Copy link
Author

I prepare a fix and I'm trying to fix unit test now. And looks like i can't push to repo. Maybe i do something wrong. i will check Guidelines again

@ai
Copy link
Contributor

ai commented Oct 20, 2024

You need to push to your fork and the crate pull request

@DisaPadla DisaPadla linked a pull request Oct 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Ready to Take
Development

Successfully merging a pull request may close this issue.

2 participants