How to handle UTF8 characters like "é" within the URL in SHELL SCRIPT?

P

Praveen

Guest
Hi All,

There are many image URLs in a .TXT file and I am downloading and renaming the downloaded file, within in a LOOP. As long as the photo file name is in English everything is working fine. But when the UTF8 characters like "é" or "à" are present in the file name, shell script is just ignoring the download and the renaming activity. I think even the curl command is not able to ping URL with such special characters.

How can I handle such file names?

Please help.

Thanks in advance.

Regards
Praveen
 


You have to percent-encode the UTF-8 byte sequence.

I just experimented by renaming a file on my server to a name with an í (accented i) character and then viewing the directory with my browser and capturing the URL. It represented the character as %c3%ad. I was able to use curl to fetch it like that.
 

Members online


Latest posts

Top