Support for special characters in URLs
Posted: Sun Jul 29, 2018 7:05 am
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).
After Punycode encoding, it works as expected:
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.
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."
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."
I wish the functions in PB's HTTP library would do that, too. Thanks for considering it.