I am displaying images from an URL using XML parsing and some images are displaying very well, but sometimes I get exception like
Illegal character in path at index 113: http://www.theblacksheeponline.com/party_img/thumbspps/12390867930_15951_186997180114_709920114_4296270_6115611_n%5B1%5D.jpg
How to solve this problem, please provide some sample code…
Special characters need escaping such as
%5Bfor [ and%5Dfor ]You can use the
java.net.URLEncoderto encode the URL as inURLEncoder.encode(myurltoencode,"UTF-8");
This will not just fix the [ or ] but also other encoding issues