rstacruz / sinatra-assetpack

Package your assets transparently in Sinatra.
http://ricostacruz.com/sinatra-assetpack/
MIT License
542 stars 97 forks source link

Read files with utf-8 encoding #187

Open Paxa opened 9 years ago

Paxa commented 9 years ago

If css file contain some non ascii characters it will fail with exception

For example it fail on https://github.com/dbushell/Pikaday/blob/master/css/pikaday.css (© is not ascii)

This commit read all files in utf-8 encoding

j15e commented 9 years ago

What if the file is not utf-8 encoded? I think it would be better to read the file binary then detect encoding as done in sprocket for exemple : https://github.com/sstephenson/sprockets/blob/faceba518a866aee4c454775112a578e2f3ff166/lib/sprockets/mime.rb#L79-L102

Paxa commented 8 years ago

Anyone wanna implement encoding detection or we close pull request?

j15e commented 8 years ago

In case you missed it, see #197