tip_URLEncode + instead of %20
Posted: Mon Feb 21, 2022 5:49 pm
Dear friends,
To use an WEB API call I am required to encode a string with URLEncode
https://en.wikipedia.org/wiki/Percent-encoding
In Harbour this can be done using the tip_URLEncode function (HBTIP Library).
So I tried the simple line below:
I was expecting the result below:
But instead I got:
I found out both "+" and "%20" are used to replace a SPACE character.
In the link below the statement is "%20" is more modern:
https://stackoverflow.com/questions/163 ... cter-or-20
Is there a modified version or alternative function to do the URLEncoding ?
Best regards,
Theo
To use an WEB API call I am required to encode a string with URLEncode
https://en.wikipedia.org/wiki/Percent-encoding
In Harbour this can be done using the tip_URLEncode function (HBTIP Library).
So I tried the simple line below:
Code: Select all
MsgDebug( tip_URLEncode("Microsoft Office") )Code: Select all
Microsoft%20OfficeCode: Select all
Microsoft+OfficeIn the link below the statement is "%20" is more modern:
https://stackoverflow.com/questions/163 ... cter-or-20
Is there a modified version or alternative function to do the URLEncoding ?
Best regards,
Theo