views:

462

answers:

2

Hi,

Very confused here, trying out the yuicompressor on a simple javascript file.

My js file looks like:

function splitText(text)
{
    return text.split('-')[1];
}

The error is:

[INFO] Using charset Cp1252

[Error] 1:20:illegal character [Error] 1:20:syntax error [Error] 1:40:illegal character [Error] 1:49:missing ; before statement [Error] 1:50:illegal character .. .. [Error] 7:3:missing | in compound statement [error] 1:0:compilation produced 38 syntax errors ...

Can someone please explain to me what is wrong?

+2  A: 

Your encoding of the actual file YUICompressor is acting on is the issue. Open the file in notepad++ and change to ANSI & it should work.

[http://extjs.com/forum/showthread.php?t=27732][1]

Tim Boland
A: 

Great answer Tim,

For the [ERROR] NUMBERS??? :missing ; before statement

If you use Aptana go to file properties and choose the right File Text Encoding.

I worked for me..

Thanks,

Wilmag