In my FireMonkey Apps, I can simply add the System.NetEncoding unit to my uses list and then use the TNetEncoding.URL.Encode() and TNetEncoding.URL.Decode() functions, but the System.NetEncoding isn't available in TMS WEB Core.
I've also tried the IdURI and HTTPApp units, but they're not available either.
Is there perhaps a TMS unit for encoding and decoding URLs in TMS WEB Core?
Delphi has a long history full of timult dealing with Url encoding:
And then Windows itself has a selection of functions:
#or?PARSE_CANONICALIZEandURL_ESCAPE_UNSAFEIf your FireMoney app is not running on Windows, then you might have to simply cave and roll your own.
Just be aware that a lot of implementations will say that the only valid characters in URLs are:
and escape anything else. When in reality the following is a valid and allowed URL:
And each of your different parts have different rules about what is allowed.
httpexample.com80/:@-.!$&'(),=;:@-._~!$&'()*,=:@-.!$&'(),==?/?:@-._~!$'()*,;=/?:@-._~!$'()*,;==#/?:@-._~!$&'()*,;=What's more is that depending on your use case, maybe you want to urlencode the entire string:
http://stackoverflow.com/http%3A%2F%2Fstackoverflow.com%2FWhen maybe in reality you only wanted it to escape "bad" urls:
https://stackoverflow.com/terms of servicehttps://stackoverflow.com/terms%20of%20servicetl;dr: Try to use Windows.