git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@786506 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -385,6 +385,9 @@ Fixed bugs: | |||||
| the setbeans attribute. | the setbeans attribute. | ||||
| Bugzilla Report 47336. | Bugzilla Report 47336. | ||||
| * <loadproperties>' encoding attribute didn't work. | |||||
| Bugzilla Report 47382. | |||||
| Other changes: | Other changes: | ||||
| -------------- | -------------- | ||||
| * A HostInfo task was added performing information on hosts, including info on | * A HostInfo task was added performing information on hosts, including info on | ||||
| @@ -168,11 +168,7 @@ public class LoadProperties extends Task { | |||||
| if (!text.endsWith("\n")) { | if (!text.endsWith("\n")) { | ||||
| text = text + "\n"; | text = text + "\n"; | ||||
| } | } | ||||
| if (encoding == null) { | |||||
| tis = new ByteArrayInputStream(text.getBytes()); | |||||
| } else { | |||||
| tis = new ByteArrayInputStream(text.getBytes(encoding)); | |||||
| } | |||||
| tis = new ByteArrayInputStream(text.getBytes()); | |||||
| final Properties props = new Properties(); | final Properties props = new Properties(); | ||||
| props.load(tis); | props.load(tis); | ||||
| @@ -58,4 +58,14 @@ xref-complex.f=$${xref-complex.e}</string> | |||||
| <au:assertPropertyEquals name="xref-complex.f" value="$${xref-complex.d}" /> | <au:assertPropertyEquals name="xref-complex.f" value="$${xref-complex.d}" /> | ||||
| </target> | </target> | ||||
| <target name="testEncoding" | |||||
| description="https://issues.apache.org/bugzilla/show_bug.cgi?id=47382"> | |||||
| <mkdir dir="${input}"/> | |||||
| <echo file="${input}/ebcdic.properties" encoding="Cp1047"> | |||||
| a=Hello world in EBCDIC | |||||
| </echo> | |||||
| <loadproperties srcfile="${input}/ebcdic.properties" encoding="Cp1047"/> | |||||
| <au:assertPropertyEquals name="a" value="Hello world in EBCDIC"/> | |||||
| </target> | |||||
| </project> | </project> | ||||