How exactly do you escape special characters from ANT? Say if you need to add extra ” quotation characters within a property which already has a set of quotes?
Here’s how to do it — use XML Character entity references:
For > use >
For < use <
For “ use "
For & use &
For ‘ use '
Any other characters you need? Drop me a line..
3 comments in this article
February 17, 2010 am28 5:11
Thanx for great article.
March 3, 2011 pm31 22:08
How can we escape . (dot) in ant?
January 16, 2012 am31 1:35
Hello,
Could you tell me how could I escape the ” and & characters in the properties files? I need to pass a string containing & to the command line and it constantly fails to work. If I echo the output and copy+paste in the command line manually it works but from the script it fails.
Any help would be appreciated, I even tried replacing ” and & with unicode correspondent code and still no result