I'm getting an Android web image, but the image is not loaded from a specific url.

Asked 2 years ago, Updated 2 years ago, 99 views

Loading photos via communication with other urls is handled normallyten thousand For example, url with Hangul (for example, http://site/directory/httpg) In the same case, the image is not loaded. I connected this url with chrome just in case The image appears well in Chrome. In the case of url, which includes Korean, is a separate encoding process necessary?

android encoding

2022-09-22 20:22

1 Answers

You need to request it by encoding it in the encoding format used by the server.

For example, if the server has UTF-8 encoding, you can do the following:

String imageName = URLEncoder.code("Hangul.jpg", "UTF-8");

//If you use Glide to load an image of http://site/directory/hangeul.jpg,
Glide
        .with(context)
        .load("http://site/directory/" + imageName)
        .into(imageView);

The main contents of URLEncoder are as follows.


2022-09-22 20:22

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.