-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compile_file does not allow to pass a specific encoding #1965
Comments
OK, found out how to do it, since cli had an option for exactly this: Encoding.default_external = "UTF-8"
Sass.compile_file(filename) Not sure if it would be worth adding a |
That's an oversight. The encoding should be specifiable as an option. Ruby's file API allows a per-file-read specification of the encoding. Setting |
How can I find the most easy "Help Wanted" issues? I'm new but would like to contribute. |
I'm moving this issue to the new Ruby Sass repository because it's specific to Ruby Sass's implementation. Once it's there, I'm going to close it as "on ice" because Ruby Sass is deprecated and no additional features are planned for it. |
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: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 awritebin
function in the docs). I can work around those issues, but I figured I still post this here.The text was updated successfully, but these errors were encountered: