views:

483

answers:

4

Hi,

I am getting some errors when trying to run yuicompressor.

it says:

[error] 1:2:illegal character
[error] 1:2:syntax error
[error] 1:3 illegal character

Could this be because I am saving it as the wrong encoding or something?

update

first few lines of my code

function page_init()
{

    $().ready( function()
    {
+9  A: 

I have seen issues with YUICompressor and files that are saved in UTF-8 with the Byte Order Mark (BOM). The default for Visual Studio 2008 seems to be to save them this way. To solve it, I had to save the file with a different encoding. In VS2008, this was File - Advanced Save Options - Encoding : Unicode (UTF-8 without signature).

Kevin Hakanson
+1  A: 

In addition to saving under "UTF-8 without signature encoding", I had to switch to Windows style line endings (CR LF).

A: 

I ran across this issue today. Another fix is to provide the "--charset utf-8" option on the command line.

A: 

While viewing the .js file in Visual Studio 2008... File -> Advanced Save Options -> Unicode (UTF-8 without signature).

Kris Krause