Menu

illegal character /65279 in generated file

Help
gyrae
2008-10-01
2013-04-25
  • gyrae

    gyrae - 2008-10-01

    Dev. Environment
    OS Windows: 2000
    Text editor: JEdit
    Generator: SQL2JAVA
    Java version: The last 5.x version

    Problem:
    All Java files generated start with (at the top left corner) one or more "illegal character /65279". Depending on the text editor, it manifest itself as "." or "@" or   "?". One "illegal character /65279" per #parse("*.vm") used in the input file.

    -----------------------------------------------------------------------------------------------------------------------------------------------
    Sample of the problem:
    -----------------------------------------------------------------------------------------------------------------------------------------------
    =========
    INPUT FILE
    =========

    #include("header.include.vm")

    #parse("def.include.vm")

    $codewriter.setCurrentFilename("odms-entity/src/java/$entityIntfPkg", "${beanInterface}.java") ##

    package $entityIntfPkg;

    #foreach ($linkedTable in $linkedTables)

    import ${linkedTable.getPackage()}.entity.bean.${linkedTable.asBeanClass()};

    #end

    /**

    * The ${beanInterface} interface.

    *

    end

    *

    * @author  $projAuthor,  $projCompany

    * @version $projVersion,

    * @date      $projDate

    */

    public interface ${beanInterface} extends #if ($extendsInterface) ${entityIntfPkg}.${extendsInterface}, #end java.io.Serializable{

    .

    .

    }

    ========
    OUTPUT

    ========
    ??/**   //NOTE ??  PROBLEM  <--- illegal character /65279/**
    * Header
    *
    */

    package xxx.xxxxxxxxxxx.xxxx.entity.intf;

    /**

    * The AuditTableIf interface.

    *

    end

    *

    * @author  XXXXXXXX XXXXXXXX,  XXXXXXXXXXXX XXXXXXXXXXXXXX.

    * @version 1.0.3,

    * @date      Wed Oct 01 08:58:15 BST 2008

    */

    public interface AuditTableIf extends  java.io.Serializable{

    .

    .

    }
    -----------------------------------------------------------------------------------------------------------------------------------------------
    Required:
    Could someone help me clear this problem. I am working on a very big project, which contains 52 tables to generate--further multiply that by 12 files) and you can see how impossible it is to do delete them manually in each file. Finding a workaround is causing a distraction from my main work. Please help, and thanks in advance.

    .

     

     
    • Gerits Daan

      Gerits Daan - 2008-10-01

      Hello gyrae,

      Can you post the contents of your def.include.vm template file?

      Does the same problem occur when you are generating a template which parses a plain text template (not java code). try something like:

      Test Text Message

      as content for the test template.

      Regards,

      Daan

       
    • Alain Fagot Béarez

      The character \65279 is x'FEFF', which is the Unicode byte order mark; pointing to the first byte of the source file. It could have been introduced if your templates are using non-ASCII characters and your system locale encoding is not set to UTF-8 by default.

      You should use the "-encoding Unicode" option to the javac compiler in order to compile these files.  Or try to generate on some platform where the locale's default encoding is set to UTF-8.

      You may want to refer to the following discussion and the related "bug report":
      http://forums.sun.com/thread.jspa?threadID=5181075&start=0&tstart=0
      http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4062258

      Regards,
      Alain

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.