flyerhq / flutter_link_previewer

Customizable link and URL preview extracted from the provided text with the ability to render from the cache. Ideal for chat applications.
MIT License
72 stars 75 forks source link

utf-8 unicode issue #32

Closed ehabelnahas closed 2 years ago

ehabelnahas commented 2 years ago

Hello, Great package, and most is working very well,

I just have an issue when the website data returned in a different language than English, then it shows strange characters (try website which is in Arabic or so.), I searched about the problem, and I found solutions say that the data returned has to be utf-8 decoded, actually I tried to implement that to the final data returned from the package (I mean to encode it later before displaying) but I went into many errors.

Appreciate if you can help solving the issue once url data is returned by http.get, thanks in advance

demchenkoalex commented 2 years ago

Hi, thank you!

On this line we stop parsing anything that doesn't specify utf8 charset. I don't remember why we did that, there were parsing problems or something, but for sure it was added for a reason. Maybe dependencies were updated and now that works? If you can please comment that line out and see if parser works, we can fix that easily then, but if it fails, I guess that's on 3rd party deps. Also, maybe we can somehow convert the http.get response to utf8 before starting parsing, another thing to check.

ehabelnahas commented 2 years ago

Am really sorry for annoying, As per your answer, I tried other Arabic urls and it seems that it was working already, and the one with strange characters (I sent you about) has a problem itself. So, I can say, the package is working perfectly.

Thank you