Bug 60421 - concat task: encoding problem with in-line string
Summary: concat task: encoding problem with in-line string
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.9.7
Hardware: All All
: P2 major (vote)
Target Milestone: ---
Assignee: Ant Notifications List
Depends on:
Reported: 2016-11-26 09:36 UTC by Simon Sch.
Modified: 2016-11-26 09:36 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Simon Sch. 2016-11-26 09:36:54 UTC
Concat task with in-line string may fail, e.g.:

<property name="fileContent" value="&#x00c4;&#x00d6;&#x00dc; &#x00e4;&#x00f6;&#x00fc; &#x00df;"/>
<concat destfile="output-wrong.txt" outputencoding="iso-8859-15">${fileContent}</concat>

The encoding of concat task (default: null) will not forwarded to embedded StringResource (default encoding: UTF-8; formerly: null). It only works when encoding attributes of Concat task and StringResource matches.


<property name="fileContent" value="&#x00c4;&#x00d6;&#x00dc; &#x00e4;&#x00f6;&#x00fc; &#x00df;"/>
<concat destfile="output-fixed.txt" encoding="utf8" outputencoding="iso-8859-15">
    <string encoding="utf8">${fileContent}</string>

-> use explizit StringResource and define matching encoding values for <concat> and <string>.