sass / ruby-sass

The original, now deprecated Ruby implementation of Sass

Home Page:https://sass-lang.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

compile_file should take an encoding option

nex3 opened this issue · comments

From sass/sass#1965:

To be clear, I'm talking about input encoding, output is always utf-8.

Maybe I'm missing something, but I couldn't figure out how to define a specific encoding for input files if they lack any bom or charset declaration. Therefore ruby sass will probably apply the default encoding, which would be CP850 in my case. But I know that the file in question is utf-8, so I would expect:

Sass.compile_file(filename, :encoding => "UTF-8")

Btw. I find it quite puzzeling that it also seems impossible in ruby to open a file in utf-8 encoding with the newline conversion disabled. We have some spec tests results that contain single \r chars, which get converted to \n by ruby io if newline conversion is on. But I'm using 1.9.3, so that may already be solved (saw a writebin function in the docs). I can work around those issues, but I figured I still post this here.

I'm closing this issue as "on ice" because Ruby Sass is deprecated and no additional features are planned for it.