Skip to content

Conversation

@kawmra
Copy link
Contributor

@kawmra kawmra commented Feb 28, 2018

Problem

When we paste the URL, the title of the website is automatically fetched, but if it was encoded by non-utf8 encoding it could not be decoded correctly and it garbled.

My proposal

Check the Content-Type header of the HTTP response when fetching the website from the URL, and if the charset is specified, decode response with iconv as that charset before getting title.
If charset is not specified or not supported, the response will be decoded as utf-8.

before

before

after

after

@Rokt33r Rokt33r self-requested a review February 28, 2018 16:16
@Rokt33r Rokt33r added the awaiting review ❇️ Pull request is awaiting a review. label Feb 28, 2018
@Rokt33r
Copy link
Member

Rokt33r commented Feb 28, 2018

I surprise that yahoo is still using EUC-JP... 😱 😱 😱 Thanks for your contribution.

@kawmra
Copy link
Contributor Author

kawmra commented Feb 28, 2018

yeah I surprised too.. Thank you for your review!

@Rokt33r Rokt33r merged commit 7d3d96a into BoostIO:master Mar 5, 2018
@Rokt33r Rokt33r added next release (v0.11.0) and removed awaiting review ❇️ Pull request is awaiting a review. labels Mar 5, 2018
@kawmra kawmra deleted the fix-title-decoding branch March 14, 2018 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants