HttpURLConnection无法打开含有中文的链接
方法:使用 URLEncoder
URLEncoder.encode(str, “utf-8”);
filepath = “http://localhost/movie/爱的发声练习.srt”
String srtname = filepath.substring(filepath.lastIndexOf(“/”) + 1);
filepath = filepath.substring(0,filepath.lastIndexOf(“/”))+
“/”+URLEncoder.encode(srtname,”utf-8”);
URL url = new URL(filepath);
HttpURLConnection conn = (HttpURLConnection) url
.openConnection();