• We did not send an email asking for donations - please read this post.

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



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.




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.
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Staff online

Members online