Ensure UTF-8 string from any source with Ruby
August 1st 2011Sometimes, when you need to download an html web page, it can be interpreted as a wrong encoding, causing errors with accents, and special characters.
You can avoid those problems converting to UTF-8. As follows:
And just calling ensure_utf8 function:
Hope it helps.




