ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lokesh Jain <>
Subject Re: Incorrect reading of property containing accented chars from by custom task
Date Tue, 24 Apr 2012 09:18:54 GMT
Ok, here's the deal.

The properties file is generated in ISO8859-1 encoding but(and this is 
what I didn't realise :-[ ) when I edit the file to put the 
APPLICATION_GUID as HELLOÀÁÀ, both vim and gedit convert the file into 

I used iconv to reconvert the file into ISO8859-1 and now it seems to be 

However, when I use Firefox to view the same file, it shows the encoding 
as KOI8-R :-\ . This probably speaks more about Mozilla's unreliability.

Anyways, thanks for your assistance. It was highly appreciated.


On 4/23/2012 9:33 PM, Stefan Bodewig wrote:
> On 2012-04-23, Lokesh Jain wrote:
>> On 4/23/2012 1:53 PM, Stefan Bodewig wrote:
>>> On 2012-04-21, Lokesh Jain wrote:
>>>> But on a CentOS box, the same property is read by the task program
>>>> along with some junk unicode chars. Consequently, the strings do not
>>>> match which affects some of the internal logic of the ant task.
>>> What is "the task programm"?  And how does it read the properties?
>>> Maybe this one is expecting a different encoding than they have been
>>> written with?
>> I apologize for not being clear earlier. The task program refers to
>> the java class used as the custom ant task. The property file is being
>> read using Ant's built-in property task. What I meant to say was that
>> the java custom task class field corresponding to ${APPLICATION_GUID}
>> property had junk/incorrect chars for its value.
>>> Does Ant's built-in property task (maybe using a prefix) work?
>>> Something like
>>> <property file="" prefix="foo"/>
>>> <echo>${foo.APPLICATION_GUID}</echo>
>> I am afraid echoing is also returning the same junk/incorrect chars.
> In that case most likely is not ISO-8859-1 encoded, no
> matter what your Firefox says 8-)
> Can you perform a binary diff of the Windows and Linux generated files?
> If the file happens to use the platform's native encoding and you cannot
> change the code that generates it, you can use Ant's copy task with an
> outputencoding of ISO-8859-1 to re-code it.
> Maybe you should try (untested)
> <copy file="" tofile=""
>        outputencoding="ISO8851-1" filtering="true"/>
> <property file="" prefix="foo"/>
> <echo>${foo.APPLICATION_GUID}</echo>
> to verify whether it is an encoding issue.
> Stefan
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message