I need to retrieve some data from a website with a URL that might contain french accents.
To build my URL I use this:
Code: Select all
cSTR := 'Brabançonnestraat'
cBHUIS_NR := '6'
cGEMNM := 'LEUVEN'
oEncoder := TIPEncoder():New( "url" )
cSTR := oEncoder:Encode( cSTR)
url := 'http://loc.geopunt.be/geolocation/location?q=' + cSTR + '%20'+ cBHUIS_NR + ',' + ALLTRIM(cGEMNM)
http://loc.geopunt.be/geolocation/locat ... 206,LEUVEN ==> wrong
instead of:
http://loc.geopunt.be/geolocation/locat ... 206,LEUVEN ==> good
%E7 is Windows-1252 and I need the UTF8 conversion.
How can I force the encoder to convert to UTF8?
See: https://www.w3schools.com/tags/ref_urlencode.asp
Serge