From ab8c8e14e9b1bda16f0f86934890378edd6a9485 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 19 Jun 2009 13:45:58 +0000 Subject: [PATCH] loadproperties' encoding attribute is broken. PR 47382 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@786506 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 3 +++ .../org/apache/tools/ant/taskdefs/LoadProperties.java | 6 +----- src/tests/antunit/taskdefs/loadproperties-test.xml | 10 ++++++++++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/WHATSNEW b/WHATSNEW index 63c03b837..da9f06c8c 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -385,6 +385,9 @@ Fixed bugs: the setbeans attribute. Bugzilla Report 47336. + * ' encoding attribute didn't work. + Bugzilla Report 47382. + Other changes: -------------- * A HostInfo task was added performing information on hosts, including info on diff --git a/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java b/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java index dfd98b45a..0fbaf0fee 100644 --- a/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java +++ b/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java @@ -168,11 +168,7 @@ public class LoadProperties extends Task { if (!text.endsWith("\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(); props.load(tis); diff --git a/src/tests/antunit/taskdefs/loadproperties-test.xml b/src/tests/antunit/taskdefs/loadproperties-test.xml index b8421f1b0..1ebd5c27e 100644 --- a/src/tests/antunit/taskdefs/loadproperties-test.xml +++ b/src/tests/antunit/taskdefs/loadproperties-test.xml @@ -58,4 +58,14 @@ xref-complex.f=$${xref-complex.e} + + + +a=Hello world in EBCDIC + + + + +