0

I´m trying to get the value of node in the xml file. I observed that value is wrong. I´m belive that problem is the encoding. Someaone can help me ? below is my code:

In xml File:

<?xml version="1.0" encoding="UTF-8" ?>
<projects>
    <project>
       <application>Padrão</application> <!-- The problem is the character ~ -->
       <name>padrao</name>
       <icon>c:\buffer</icon>
       <market>br.com.tls.test</market>
  </project>
</projects>

My ant code

<xmltask source="config.xml"  encoding="UTF-8">
    <call path="//project">
       <param name="name" path="name/text()" />
       <param name="market" path="market/text()" />
       <param name="icon" path="icon/text()" />
       <param name="application"  path="application/text()" />

          <actions>
             <echo message="@{application}" />
             <init-release name="@{name}" market="@{market}" icon="@{icon}"  application="@{application}"/>
          </actions>
     </call>
</xmltask>

Result

[echo]:    padr#o

expected

[echo]:    padrão

Solution

I changing the file to UTF-8 and I´d sucess in the replace.

j0k
  • 22,600
  • 28
  • 79
  • 90
thiagolsilva
  • 439
  • 4
  • 11
  • 1
    If your question is solved, you should post an answer and accept it instead of putting *solved* into your title – j0k Aug 07 '12 at 13:17

1 Answers1

0

I haven't used xmltask, but echo task also has encoding property, have you tried setting that as well?

e.g. <echo message="@{application}" encoding="UTF-8" />

Sheepy
  • 17,324
  • 4
  • 45
  • 69