Home > Back-end >  Flutter Image from Arabic URL
Flutter Image from Arabic URL

Time:11-21

I try:

Image.network("http://ar.latifaonline.com/wp-content/uploads/2022/08/ألبوم-لطيفة-2022.png"),

but that does not work because Arabic characters convert to become :

"http://ar.latifaonline.com/wp-content/uploads/2022/08/ألبوم-لطيفة-2022.png"

and that does not give any image but returns this error:

Exception has occurred. HttpException (HttpException: Connection closed before full header was received, uri = http://ar.latifaonline.com/wp-content/uploads/2022/08/ألبوم-لطيفة-2022.png)

CodePudding user response:

The reason you get this error is not because of the Arabic characters, is because of http, change it to https and it will work.

if you don't have access to your backend code try this:

String yourUrl =
        "http://ar.latifaonline.com/wp-content/uploads/2022/08/ألبوم-لطيفة-2022.png";

yourUrl = yourUrl.replaceFirst('http://', "https://");

Image.network(yourUrl)
  • Related