-
Notifications
You must be signed in to change notification settings - Fork 463
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
error on UTF-8 with sugnature files #22
Comments
Can you attach a sample failing file?
On Jul 6, 2012, at 10:27 AM, [email protected] wrote:
|
Sure! |
I've sent it via email. I writing the .Net wrapper for libsass, so I compiled the sources with MS C++ compiler in CLR mode. |
I'm using Sassc on Windows, and with many files created by Visual Studio I get the same error: "invalid top-level expression". I made the test with the latest versions of libsass and sassc. Here is an example of a file that does not compile: Thanks, |
The UTF-8 BOM is |
Thanks Craigbarnes for your comment! This problem prevents me from using Sassc on several of my projects, and unfortunately I don't have an enough good level in C++ to provide a fix. |
If you're using Visual Studio, I think you can set the encoding to |
Yes, but as the default files created by Visual Studio are with BOM, it will be dificult to ask all my team members to manually change the encoding each time they create a new scss file. |
Just check for those three bytes? No problem. |
Hi Aaron, |
I'll work on this one right now. |
All right, I added checks for all of the BOMs listed on the Wikipedia page: http://en.wikipedia.org/wiki/Byte_order_mark Please let me know whether or not it works for you. |
I did a test with your latest commit, and all the encoding errors have disappeared. |
I ran into this issue today using gulp-sass/node-sass/libsass that was due to creating the .scss file in Visual Studio 2012, which created a UTF-8 encoded file. Opening the file in notepad and changing the encoding to ANSI solved the |
The top-level expression is probably the BOM, so it sounds like gulp-sass/node-sass are using an older version of libsass. You might be able to save it as UTF-8-without-BOM and that might work. No guarantees that non-Latin characters might not be a problem without updating libsass though. |
This might have something to do with the pull request #283. IMO this change makes the parser to recognise the BOM as alpha characters and therefore seeing it as an expression? But I guess libsass should just "throw away" the BOM once it has determined there is one (this is also very true for imports, as you do not want the BOM to be inserted in the source document). But from the age of this bug I would have guessed that this has already been solved? |
Got this same error today. Found out I had a redundant expression in my gruntfile.js file: |
When trying to process file with UTF-8 with signature (BOM) encoding, getting error:
ERROR -- filename, line 1: invalid top-level expression
The text was updated successfully, but these errors were encountered: