-
Notifications
You must be signed in to change notification settings - Fork 33
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
Wrong encoding? #24
Comments
@geniuscodemonkey Thanks for the report, will look into it as it might be libsass bug and not libsass-net related. |
Hi I suffer for same problem. Some testing: $my-variable: "\f000"; And on both way if using actual utf-8 character its also leads to "". In my case its fine to get eather ascii representation \f000 or actual utf character . |
The sassc command-line tool from native C/C++ libsass is having the same encoding issue. sass/libsass#1235 looks into this... |
I think it's the same issue with the content: "✔"; which generates this: content: "✔"; I don't think it's a libsass issue since this issue doesn't seem to repro in the node module. Perhaps the |
Is there a work around for this issue? Right now font-awesome or bootstrap are not even usable, it's all a encoding mess. |
Sorry, I couldn't find a work around for this; but I didn't look to closely at the GitHub code. Sent from my Samsung Galaxy smartphone. -------- Original message -------- Is there a work around for this issue? Right now font-awesome or bootstrap are not even usable, it's all a encoding mess. — |
The spec test https://github.com/sass/sass-spec/tree/master/spec/libsass-closed-issues/issue_1231 (for sass/libsass#1231) is passing with LibSass.NET master, so this should be fixed with the upcoming release.
@mixin pseudoFontIcon($content) {
content: $content;
}
a:before {
@include pseudoFontIcon('\e003');
} C# code: var options = new SassOptions
{
InputPath = "path\\to\\my-test.scss"
// Note: here if we add another option:
//
// OutputStyle = OutputStyle.Compressed
//
// compiler will not produce @charset "UTF-8"; statement in
// the output but instead use the byte-order-mark (BOM). This
// is totally fine, because either way browser will show the
// right thing.
};
var sass = new SassCompiler(options);
var result = sass.Compile();
File.WriteAllText("path/to/styles.css", result.Output); // IO writes are now handled by consumer
// (probably later in a separate extension package: LibSass.NET.Extensions)
// either way no encoding is necessary to be passed to WriteAllText method Do - verify the styles.css in browser. .. because the rendered Unicode chars are different than @mixin pseudoFontIcon($content) {
content: #{"\""+$content+"\""};
}
a:before {
@include pseudoFontIcon(\e003); // without single/double quotes here
} The important thing is, while both outputs looks different in text editor, they produce same effect when rendered by the browser. |
Since it's fixed, i'm closing the issue. |
Hi,
When I have a "content: '\e003';" in scss the file gets converted to "content: "";" instead of keeping the "\e003" ascii value.
This is using the CompileFile function.
KR
MK
The text was updated successfully, but these errors were encountered: