Skip to content

getURL does not work with accented words

Reported by Antoine Monmayrant

BUG DESCRIPTION:
----------------

getURL is not working properly when using accented words in the URL (as parameters).
For example, "Joël" is turned into "Joël".
There might be some encoding issue somewhere along the line.
See below a minimum working example using api.genderize.io to try to determine the gender given a firstname.
Tested on linux 64 bits (ubuntu 16.04.3).


ERROR LOG:
----------
No error but the accented word is not passed correctly to the website.


HOW TO REPRODUCE THE BUG:
-------------------------


name="Joël";

//This works using wget
unix("wget https://api.genderize.io/?name="+name+" -O tmp1.txt")
edit("tmp1.txt");
// {"name":"Joël","gender":"male","probability":1,"count":4}// that's the expected answer from the website
    
//This does not work using getURL
filename=getURL("https://api.genderize.io/?name="+name,"tmp2.txt")
edit("tmp2.txt");
//    {"name":"Joël","gender":null}// the name sent to the website is mangled and gender cannot be determined



OTHER INFORMATION:
------------------