Browse Source

Properly deal with multi-byte encodings by reusing existing code that does.

PR: 19187


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274509 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 22 years ago
parent
commit
c3a9038765
2 changed files with 4 additions and 11 deletions
  1. +3
    -0
      WHATSNEW
  2. +1
    -11
      src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java

+ 3
- 0
WHATSNEW View File

@@ -106,6 +106,9 @@ Fixed bugs:
* build.sh install had a problem on cygwin (with REALANTHOME).
Bugzilla Report 17257

* <replaceregexp> didn't work for multi-byte encodings if byline was false.
Bugzilla Report 19187.

Other changes:
--------------
* Six new Clearcase tasks added.


+ 1
- 11
src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java View File

@@ -416,17 +416,7 @@ public class ReplaceRegExp extends Task {

pw.flush();
} else {
int flen = (int) f.length();
char tmpBuf[] = new char[flen];
int numread = 0;
int totread = 0;

while (numread != -1 && totread < flen) {
numread = br.read(tmpBuf, totread, flen);
totread += numread;
}

String buf = new String(tmpBuf);
String buf = fileUtils.readFully(br);

String res = doReplace(regex, subs, buf, options);



Loading…
Cancel
Save