Posted on September 12, 2020 at 11:53 am
Example URLEncode() function converted from PHP to Delphi:
function URLEncode(const aData: AnsiString): AnsiString; const Chars: Array [0..18] of AnsiChar = (#$25, #$21, #$2A, #$27, #$28, #$29, #$3B, #$3A, #$40, #$26, #$3D, #$2B, #$24, #$2C, #$2F, #$3F, #$23, #$5B, #$5D); var sData: String; i1: DWORD; begin sData := String(aData); for i1 := Low(Chars) to High(Chars) do sData := StringReplace(sData, String(Chars[i1]), '%' + IntToHex(Ord(Chars[i1]), 2), [rfReplaceAll, rfIgnoreCase]); result := AnsiString(sData); end; |
Other Posts
- Set OpenVPN to Listed on a Specific IP Address
- Bash Trim Leading and Trailing Whitespace from a String
- Bash Get Name of Ethernet Network Interface
- VPN Providers with Dedicated Static IP Address
- OpenVPN Iptables Rules
- WireGuard VPN Iptables Rules
- How to Install WireGuard VPN in Debian 10 Buster
- Bash: No space left on device (inodes issue)
Updated Posts
- Add Desktop shortcut for all Windows PC users
- How to pass custom command-lien parameters in InnoSetup
- Programmatically create desktop icon with InnoSetup
- GeneratePress - a Lightweight WordPress Theme 2021
- InnoSetup disable DesktopIcon via command-line
- Use cURL to authenticate with JWT Bearer tokens
- Detect VMWare Virtual Machine
- Detect Microsoft Virtual PC Virtual Machine