Return-Path: Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Delivered-To: mailing list dev@ant.apache.org Received: (qmail 86577 invoked by uid 500); 24 Apr 2003 09:11:40 -0000 Received: (qmail 86574 invoked from network); 24 Apr 2003 09:11:40 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 24 Apr 2003 09:11:40 -0000 Received: (qmail 68252 invoked by uid 1146); 24 Apr 2003 09:11:39 -0000 Date: 24 Apr 2003 09:11:39 -0000 Message-ID: <20030424091139.68251.qmail@icarus.apache.org> From: bodewig@apache.org To: ant-cvs@apache.org Subject: cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional ReplaceRegExp.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N bodewig 2003/04/24 02:11:39 Modified: . WHATSNEW src/main/org/apache/tools/ant/taskdefs/optional ReplaceRegExp.java Log: Properly deal with multi-byte encodings by reusing existing code that does. PR: 19187 Revision Changes Path 1.404 +3 -0 ant/WHATSNEW Index: WHATSNEW =================================================================== RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.403 retrieving revision 1.404 diff -u -r1.403 -r1.404 --- WHATSNEW 23 Apr 2003 16:00:59 -0000 1.403 +++ WHATSNEW 24 Apr 2003 09:11:38 -0000 1.404 @@ -106,6 +106,9 @@ * build.sh install had a problem on cygwin (with REALANTHOME). Bugzilla Report 17257 +* didn't work for multi-byte encodings if byline was false. + Bugzilla Report 19187. + Other changes: -------------- * Six new Clearcase tasks added. 1.19 +1 -11 ant/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java Index: ReplaceRegExp.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- ReplaceRegExp.java 4 Apr 2003 13:51:11 -0000 1.18 +++ ReplaceRegExp.java 24 Apr 2003 09:11:38 -0000 1.19 @@ -416,17 +416,7 @@ 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);