3

Apologies if this is a stupid question - I'm an Android and Ant newbie.

I have utf8 encoded source files that I need to compile with the Android Ant build system. By default, the encoding is set to ascii. I'd be very grateful for a pointer to whatever I need to do to let the build system know that my files are utf8.

Incidentally, it works fine if I build in Eclipse, but I need to build from the command line.

Thanks!

Paul Butcher
  • 10,722
  • 3
  • 40
  • 44

2 Answers2

2

You should add java.encoding=UTF-8 to build.properties

Alexander Kosenkov
  • 1,597
  • 1
  • 10
  • 21
  • Thanks Alexander. As it happens, we have ended up modifying all our source files to use escape sequences instead of UTF-8 characters, so no longer need to do this, but this does look like it would have solved our problem! – Paul Butcher Jan 06 '11 at 13:31
-1

Take a look at android-sdk-windows\platforms[your-platform]\ant\ant_rules_r2.xml. You can find

<javac encoding="ascii" ...

line there and I guess you can change it.

Fedor
  • 43,261
  • 10
  • 79
  • 89
  • 1
    Any changes to installed platform image are bad - they will be lost on update. ANT allows to overwrite any properties with project-local files. In fact, this file does not exist anymore in recent SDK – Alexander Kosenkov Jan 02 '11 at 23:10