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:
-------------<replace.xml before> ------
<?xml version="1.0" encoding="UTF-8"?>
<web-app>
<url>file://localhost/$server_root$/deployed/archive/wcm.contentviewer.1001/ilwwcm-localrendering-portlet.war</url>
<title>â€Ø¨Ø¯ÙˆÙ† شكل عامâ€</title>
</web-app>
------------------------------------------------
My original intension is ONLY to update the content related to <url> tag.
The following is the code:
<target name ="testRegex">
<replaceregexp file="replace.xml"
match="file://localhost/\$server_root\$/deployed/archive/[a-zA-Z.0-9]+/"
replace="file://localhost/$server_root$/installableApps/"
byline="yes"/>
</target>
After I executed this target, I got the following result:
-----------------<replace.xml after>------------
<?xml version="1.0" encoding="UTF-8"?>
<web-app>
<url>file://localhost/$server_root$/installableApps/ilwwcm-localrendering-portlet.war</url>
<title>�بدون شكل عام�</title>
</web-app>
----------------------------------------------
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