Not much to say, put on the code, we all understand
Import Java.io.file;import Android.net.uri;public class Transition {/** * @param Uri * @return * Chinese processing */public static Stri Ng transition (String imageUrl) {File f = new File (IMAGEURL), if (F.exists ()) {//Normal logic Code}else{//processing Chinese path/*try {imageUrl = Urlencoder.encode (IMAGEURL, "UTF-8");} catch (Unsupportedencodingexception e) {e.printstacktrace ();} */imageurl = Uri.encode (IMAGEURL);} IMAGEURL = Imageurl.replace ("%3a", ":"), ImageUrl = Imageurl.replace ("%2f", "/"); return IMAGEURL;}}
Uri.decode and Uri.encode analysis, Urlencoder.encode and Urldecoder.decode analysis, URI and URL and urn differences see connection: http://blog.csdn.net/pcaxb/ article/details/46859599
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android URL Chinese processing