gub
gub

Reputation: 5229

ant encoding of echo doesn't respect build.xml setting

It looks like ant's echo command doesn't respect the XML encoding of the build.xml.

This build.xml outputs the expected thing (pi=π):

<?xml version="1.0" encoding="UTF-8"?>
<project default="pi">
 <target name="pi">
  <echo encoding="UTF-8">pi=π</echo>
 </target>
</project>

and this one (without the encoding on the echo command):

<?xml version="1.0" encoding="UTF-8"?>
<project default="pi">
 <target name="pi">
  <echo>pi=π</echo>
 </target>
</project>

outputs

pi=?

I am using a mac Terminal.app that is set to UTF-8, and so is the text editor. Surely the echo command should respect the XML file's declared encoding? Am I missing something?

Upvotes: 2

Views: 363

Answers (1)

Tobber
Tobber

Reputation: 7531

One might think it should obey the xml encoding, but if you look at the documentation, it states that

encoding: encoding to use, default is ""; the local system encoding. since Ant 1.7

So if your default system encoding is something else than UFT-8, this could be the problem.

Upvotes: 1

Related Questions