我正在使用Picasso图片加载库,发现它没有加载一些包含土耳其字符的网址
例如关注网址问题https://satis.ugur.com.tr/uploads/user_1122/images/ued%20buzdolabı%20görseli.png
尝试this但没有工作
public static String encodeTurkishCharactersInUrl(String url) {
String[] list = new String[] {"ü","ç","ı","ö","ğ","ş"," ","Ü","Ç","İ","Ö","Ğ","Ş"};
for (int i = 0; i< list.length ; i++) {
try {
url = url.replace(list[i], URLEncoder.encode(list[i],"UTF-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
return url;
}
答案 0 :(得分:0)
我找到了一个解决办法,避免使用UTF8编码的空格并用%20手动替换所有空格,现在网址正在工作
<i>