Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 4756 invoked from network); 17 Nov 2008 09:04:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Nov 2008 09:04:18 -0000 Received: (qmail 60659 invoked by uid 500); 17 Nov 2008 09:04:19 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 60621 invoked by uid 500); 17 Nov 2008 09:04:19 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 60610 invoked by uid 99); 17 Nov 2008 09:04:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Nov 2008 01:04:19 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [83.223.124.7] (HELO albatros.unitedhosting.co.uk) (83.223.124.7) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Nov 2008 09:02:56 +0000 Received: from www.oopsconsultancy.com (localhost.localdomain [127.0.0.1]) by albatros.unitedhosting.co.uk (8.13.1/8.13.1) with ESMTP id mAH928U8029050 for ; Mon, 17 Nov 2008 09:02:08 GMT Received: from 62.129.121.62 (SquirrelMail authenticated user bagnew@oopsconsultancy.com) by www.oopsconsultancy.com with HTTP; Mon, 17 Nov 2008 09:02:08 -0000 (UTC) Message-ID: <2230.62.129.121.62.1226912528.squirrel@www.oopsconsultancy.com> In-Reply-To: <251940.43454.qm@web111107.mail.gq1.yahoo.com> References: <251940.43454.qm@web111107.mail.gq1.yahoo.com> Date: Mon, 17 Nov 2008 09:02:08 -0000 (UTC) Subject: Re: ANT replaceregexp problem From: "Brian Agnew" To: "Ant Users List" User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Checked: Checked by ClamAV on apache.org Your XML file specifies the char encoding being used (UTF-8), but I'm guessing that the replaceregexp task won't understand this, since it's not XML-aware. So your replacement string may be getting written out using another encoding - most likely your default environment encoding. Try setting -Dfile.encoding=utf8 (or it might be utf-8, or similar. You get the idea). Note that if you want to do XML replacement, and you need to maintain encodings, then XMLTask may be a better solution. Brian On Sun, November 16, 2008 22:48, Jerry Chimey wrote: > Hi, > I am seeing a weird problem of using replaceregexp in ANT. > Basically, for the non-English characters, they are updated even though > they are not matched by the regular expression. > > The following is my original input: > ------------- ------ > > > file://localhost/$server_root$/deployed/archive/wcm.contentviewer.1001/ilwwcm-localrendering-portlet.war > �بدون > شكل عام� > > ------------------------------------------------ > > My original intension is ONLY to update the content related to > tag. The following is the code: > > match="file://localhost/\$server_root\$/deployed/archive/[a-zA-Z.0-9]+/" > replace="file://localhost/$server_root$/installableApps/" > byline="yes"/> > > > > After I executed this target, I got the following result: > ----------------------------- > > > file://localhost/$server_root$/installableApps/ilwwcm-localrendering-portlet.war > �?بدون شكل عام�? > > ---------------------------------------------- > > The url was replaced correctly; however, some characters in the title tag > were replaced with '?'. > I used ANT 1.7 and tried to use jakarta-oro-2.0.8 to perform regular > expression replacement but still got the same problem. > > C:\>ant -Dant.regexp.regexpimpl=org.apache.tools > .ant.util.regexp.JakartaOroRegexp -f test.xml testRegex > Buildfile: test.xml > > testRegex: > > BUILD SUCCESSFUL > Total time: 0 seconds > > Have anyone seen this problem and have any idea how to fix it? > > Thanks > > Jerry > > > -- Brian Agnew http://www.oopsconsultancy.com OOPS Consultancy Ltd Tel: +44 (0)7720 397526 Fax: +44 (0)20 8682 0012 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org