lib/sprockets/context.rb in sprockets-2.2.0.beta vs lib/sprockets/context.rb in sprockets-2.2.0

- old
+ new

@@ -177,10 +177,12 @@ if options[:data] result = options[:data] else if environment.respond_to?(:default_external_encoding) - result = Sprockets::Utils.read_unicode(pathname, environment.default_external_encoding) + mime_type = environment.mime_types(pathname.extname) + encoding = environment.encoding_for_mime_type(mime_type) + result = Sprockets::Utils.read_unicode(pathname, encoding) else result = Sprockets::Utils.read_unicode(pathname) end end