varshluck / closure-stylesheets

Automatically exported from code.google.com/p/closure-stylesheets
Apache License 2.0
0 stars 0 forks source link

Parse error handling UTF-16 file #45

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Setup a very simple CSS file with UTF-16 encoding (see attached file)
2. java -jar closure-stylesheets-20111230.jar "utf16-test.css"

What is the expected output? What do you see instead?
I expected it to parse the file without error.  Instead, I get:

Compiler parsing error: Parse error in utf16-test.css at line 5 column 5:
    html
    ^

com.google.common.css.compiler.ast.GssParserException: Parse error in 
utf16-test.css at line 5 column 5:
    html
    ^

        at com.google.common.css.compiler.ast.GssParserCC.parse(GssParserCC.java:163)
        at com.google.common.css.compiler.ast.GssParser.parse(GssParser.java:46)
        at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.parseAndPrint(DefaultCommandLineCompiler.java:104)
        at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.compile(DefaultCommandLineCompiler.java:94)
        at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.execute(DefaultCommandLineCompiler.java:129)
        at com.google.common.css.compiler.commandline.ClosureCommandLineCompiler.executeJob(ClosureCommandLineCompiler.java:293)
        at com.google.common.css.compiler.commandline.ClosureCommandLineCompiler.main(ClosureCommandLineCompiler.java:366)
Caused by: com.google.common.css.compiler.ast.ParseException: Encountered " 
<IDENTIFIER> "html "" at line 5, column 5.
Was expecting one of:
    ":" ...
    "." ...
    "[" ...
    "{" ...
    "," ...
    <S> ...
    <HASH_NAME> ...
    <S> ...

        at com.google.common.css.compiler.ast.GssParserCC.generateParseException(GssParserCC.java:3686)
        at com.google.common.css.compiler.ast.GssParserCC.jj_consume_token(GssParserCC.java:3565)
        at com.google.common.css.compiler.ast.GssParserCC.ruleSet(GssParserCC.java:431)
        at com.google.common.css.compiler.ast.GssParserCC.block(GssParserCC.java:2804)
        at com.google.common.css.compiler.ast.GssParserCC.start(GssParserCC.java:2851)
        at com.google.common.css.compiler.ast.GssParserCC.parse(GssParserCC.java:161)
        ... 6 more

What version of the product are you using? On what operating system?
closure-stylesheets-20111230.jar on Windows 7

Please provide any additional information below.
If I convert the same exact file to UTF8 or ASCII without the BOM, it processes 
fine.

Original issue reported on code.google.com by devm0nke...@gmail.com on 10 Jul 2014 at 3:19

Attachments: