lib/scss_lint/engine.rb in scss-lint-0.29.0 vs lib/scss_lint/engine.rb in scss-lint-0.30.0
- old
+ new
@@ -18,10 +18,12 @@
else
@engine = Sass::Engine.new(scss_or_filename, ENGINE_OPTIONS)
@contents = scss_or_filename
end
- @lines = @contents.lines.to_a # Need `to_a` for Ruby 1.9.3
+ # Need to force encoding to avoid Windows-related bugs.
+ # Need `to_a` for Ruby 1.9.3.
+ @lines = @contents.force_encoding('UTF-8').lines.to_a
@tree = @engine.to_tree
rescue Encoding::UndefinedConversionError, Sass::SyntaxError => error
if error.is_a?(Encoding::UndefinedConversionError) ||
error.message.match(/invalid.*(byte sequence|character)/i)
raise FileEncodingError,