Browse Source

fix (I think) encoding for InputStream from StringResource

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@537018 13f79535-47bb-0310-9956-ffa450edef68
master
Matthew Jason Benson 18 years ago
parent
commit
de1642bdb7
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      src/main/org/apache/tools/ant/types/resources/StringResource.java

+ 6
- 6
src/main/org/apache/tools/ant/types/resources/StringResource.java View File

@@ -15,7 +15,6 @@
* limitations under the License. * limitations under the License.
* *
*/ */

package org.apache.tools.ant.types.resources; package org.apache.tools.ant.types.resources;


import java.io.IOException; import java.io.IOException;
@@ -183,11 +182,12 @@ public class StringResource extends Resource {
if (isReference()) { if (isReference()) {
return ((Resource) getCheckedRef()).getInputStream(); return ((Resource) getCheckedRef()).getInputStream();
} }
//I can't get my head around this; is encoding treatment needed here?
return
//new oata.util.ReaderInputStream(new InputStreamReader(
new ByteArrayInputStream(getContent().getBytes());
//, encoding), encoding);
String content = getContent();
if (content == null) {
throw new IllegalStateException("unset string value");
}
return new ByteArrayInputStream(encoding == null
? content.getBytes() : content.getBytes(encoding));
} }


/** /**


Loading…
Cancel
Save