Page 1 of 1

Support for special characters in URLs

Posted: Sun Jul 29, 2018 7:05 am
by Little John
The following snippet shows, that PB's function GetHTTPHeader() does not work with a so called "Umlaut-Domain", even when it is percent-encoded. The same issue probably exists with other functions of the HTTP library (not tested).

Code: Select all

; e.g. PB 5.62 and PB 5.70 beta 1 on Windows

InitNetwork()

Debug GetHTTPHeader("https://www.purebasic.com/")   ; OK
Debug GetHTTPHeader("https://post-ärger.de")        ; -> "" (works e.g. with Firefox, though)
Debug GetHTTPHeader("https://post-%C3%A4rger.de")   ; -> "" (works e.g. with Firefox, though)
Debug "Finished."
After Punycode encoding, it works as expected:

Code: Select all

; e.g. PB 5.62 and PB 5.70 beta 1 on Windows

InitNetwork()

Debug GetHTTPHeader("https://xn--post-rger-z2a.de")   ; OK
Debug "Finished."
Punycode encoding is what browsers do internally with internationalized domain names.
I wish the functions in PB's HTTP library would do that, too. Thanks for considering it.

Re: Support for special characters in URLs

Posted: Sun Jul 29, 2018 11:17 am
by Mijikai
+1

Re: Support for special characters in URLs

Posted: Sun Jul 29, 2018 6:12 pm
by Sicro
+1