1. IMPORTANT - 11/13/2015: In light of a possible breach we have scrubbed all passwords. You will need to request a password reset through the site. Click here for more information.

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

Discussion in 'Command Line' started by Praveen, Jul 11, 2013.

  1. Praveen

    Praveen New Member

    Jan 16, 2013
    Likes Received:
    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.

  2. KenJackson

    KenJackson Active Member

    Dec 26, 2011
    Likes Received:
    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.

Share This Page