- Miguel Leeuwe
- PowerBuilder
- Friday, 12 February 2021 03:52 AM UTC
Hi,
I've used an Inet variable to be able to use the HyperlinkToURL() function.
I thought it would be a good idea to use the CoderObject to UrlEncode() the url that I'm passing in.
My URL's can point to anything like "file://..." or "http(s)//...".
The problem I'm having is that the function encodes every character !
If I would use Appeon's example to create a url for HyperLinkToUrl(), it wouldn't work, since the colon and slashes and dots all would be changed to "%whatever".
Blob lblb_data
String ls_UrlStr
lblb_data = Blob("https://www.appeon.com", EncodingANSI!)
CoderObject lnv_CoderObject
lnv_CoderObject = Create CoderObject
ls_UrlStr = lnv_CoderObject.UrlEncode(lblb_data)
// above Appeon's example, below what I'd like to do with the result:
inet lnet_base
lnet_base = CREATE n_inet
SetPointer(hourglass!)
lnet_base.HyperlinkToURL( ls_UrlStr )
destroy lnet_base
The above code won't work.
If I don't urlencode my links, they work just fine. It seems the browsers themselves already automatically convert all parts that have to be urlencoded if my url contains any spaces or even "%" in them.
So ... is the urlencode function meant to be used for something else maybe?
Is there another function that would encode a url without changing what doens't need changing when it's a link to an internet address?
regards
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.