Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2005

    Wink any experience on j2mepolish preprocessing of UTF-8 source files?

    I am adopting j2mepolish into my several j2me projects. all my source files in the projects are using UTF-8 as their encoding with some Chinese constant strings and a lot of Chinese comments in them.

    However, the j2mepolish's ant building process complains a lot about when compiling the preprocessed source files. I have checked the real executed "javac" command in the "fork" mode, and the ant correctly appended the "-encoding UTF-8" in the command line, so far so good. But when I opened the preproccessed source files using Eclipse and vim, it is obvious that some of the multibytes UTF-8 characters(Chinese characters) in the source files were corrupted. My conclusion is that j2mepolish's preprocessing doesn't take the source files encoding into account when preprocessing them, messed the multibytes characters in them, and later caused the compilation problems.

    I still don't have a solution to it. There are no instructions or directives on how to set the file encoding in the ant build file during preprocessing stage, so
    anyone have experience on this? Or any other solutions?

    Thanks a lot in advance, good day! :-)

  2. #2
    Registered User
    Join Date
    Jul 2009

    Re: any experience on j2mepolish preprocessing of UTF-8 source files?

    J2MEPolish preprocessor ant task used default system encoding when read files..
    And if source file encoding different from default system encoding some text in preprocessed files is corrupted..

    I found solution for this problem under Microsoft Windows:
    By setting the (Windows) environment variable JAVA_TOOL_OPTIONS to -Dfile.encoding=UTF8, the (Java) System property will be set automatically every time a JVM is started. You will know that the parameter has been picked up because the following message will be posted to System.err:

    Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8

Similar Threads

  1. problems building TextMTM
    By stefano_campri in forum Symbian
    Replies: 0
    Last Post: 2005-10-26, 10:00
  2. Link Errors Help me
    By TrungThanhMtad in forum Symbian
    Replies: 2
    Last Post: 2005-10-15, 05:13
  3. Series 60 SDK Appwizard on windows xp
    By moonjoor in forum Symbian Tools & SDKs
    Replies: 15
    Last Post: 2003-12-24, 10:22
  4. J2ME 2.0 will not run stand alone.
    By demirateser in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2003-10-08, 08:26

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts