Charset error

Rhett Hutchens's Avatar

Rhett Hutchens

30 Apr, 2010 07:02 PM

The compiler throws an error when compiling LESS documents that have character encoding set using @charset.

The character coding I am using is:
@charset "utf-8";

When I compile I get the following error, but if I remove the above line, the error goes away.

! Syntax Error: on line 1: expected : got " after: @charset

I am assuming that the compiler believes @charset to be a variable declaration. Some IDEs such as Dreamweaver and Aptana insert the above character encoding in new CSS files by default. Thanks.

  1. Support Staff 1 Posted by cloudhead on 05 May, 2010 12:50 AM

    cloudhead's Avatar

    Thanks for posting, this is fixed in the upcoming 2.0 version, which should be released sometime this month. It is indeed due to @charset not being parsed as a directive.

  2. 2 Posted by Rhett Hutchens on 05 May, 2010 03:15 PM

    Rhett Hutchens's Avatar

    Great. Thanks for all the hard work you've put in and for sharing your project with the community. It's very cool.

  3. 3 Posted by Stephen on 20 Jan, 2011 11:45 PM

    Stephen's Avatar

    Seems this is still a problem. ~9 months without a fix?

  4. Support Staff 4 Posted by cloudhead on 20 Jan, 2011 11:48 PM

    cloudhead's Avatar

    This has been working fine in the current LESS.js build for a while now. I don't plan on back-porting to ruby.

  5. 5 Posted by Stephen on 20 Jan, 2011 11:54 PM

    Stephen's Avatar

    All of the documentation on points to using the Ruby compiler - I guess I should google to find out about the .js version as I am getting syntax errors everywhere.

  6. Support Staff 6 Posted by cloudhead on 20 Jan, 2011 11:56 PM

    cloudhead's Avatar

    Yea the site update is long due, my apologies.

  7. 7 Posted by Stephen on 21 Jan, 2011 12:02 AM

    Stephen's Avatar

    No apologies needed, thanks for the links!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac