Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 毕加索无法从用孟加拉语编写的url加载图像_Android_Image_Url_Imageview_Picasso - Fatal编程技术网

Android 毕加索无法从用孟加拉语编写的url加载图像

Android 毕加索无法从用孟加拉语编写的url加载图像,android,image,url,imageview,picasso,Android,Image,Url,Imageview,Picasso,我使用毕加索库从远程服务器加载图像。图像url使用混合语言(孟加拉语/英语)编写。在某些设备中,它的负载与Chrome浏览器一样完美。但在我的华为设备(型号TIT-AL00)中,它无法加载。显示默认图像。我的代码是: String subjectIconUrl = https://devallorshathistorage.blob.core.windows.net/subject/Image_Subject_2018-06-12-064043044_কৃষিশিক্ষা_Krishi Shik

我使用毕加索库从远程服务器加载图像。图像url使用混合语言(孟加拉语/英语)编写。在某些设备中,它的负载与Chrome浏览器一样完美。但在我的华为设备(型号TIT-AL00)中,它无法加载。显示默认图像。我的代码是:

String subjectIconUrl = https://devallorshathistorage.blob.core.windows.net/subject/Image_Subject_2018-06-12-064043044_কৃষিশিক্ষা_Krishi Shikkha.png;

    Picasso.with(context)
            .load(subjectIconUrl)
            .placeholder(R.drawable.ic_default)
            .error(R.drawable.ic_default)
            // To fit image into imageView
            .fit()
            // To prevent fade animation
            .noFade()
            .into(holder.imageSubjectIcon);

您需要对url进行编码

Uri.encode(url,"UTF-8");
并尝试加载

范例

String subjectIconUrl = https://xyz/subject/Image_Subject_2018-06-12-064043044_কৃষিশিক্ষা_Krishi Shikkha.png;
String encoded_url = Uri.encode(subjectIconUrl); 

Picasso.with(context)
            .load(encoded_url)
            .placeholder(R.drawable.ic_default)
            .error(R.drawable.ic_default)
            // To fit image into imageView
            .fit()
            // To prevent fade animation
            .noFade()
            .into(holder.imageSubjectIcon);

请参阅:

对我的所有图像进行编码后(包括加载前用英文编写的文件名)不会加载。