Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-2462

GroovyClassLoader does not parse files saved in utf-8

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1-rc-1
    • 1.5.5
    • None
    • Vista, maven project built with <encoding>utf-8</encoding>

    Description

      The following code

      CompilerConfiguration config = new CompilerConfiguration();
      config.setSourceEncoding("UTF-8");
      gcl = new GroovyClassLoader(Thread.currentThread().getContextClassLoader(), config);
      gcl.parseClass(afile);

      causes the following error:
      1: Invalid variable name. Must start with a letter but was: ?survivantManager.
      Node: org.codehaus.groovy.ast.expr.VariableExpression. At [1:1] @ line 1, column 1.
      ?survivantManager...

      The file has been saved as utf-8 and tested with various programs to confirm that it is presented correctly, and that there is no hidden character (the one appearing as a ?) in the beginning of the file.

      Any suggestions? Or is it indeed a bug?

      Thanks for the help in advance!

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            tec-goblin Nicolas KP
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: