DWScript provides built-in classes for converting between different data representations like Base64, Hex, and URL encoding.
Standard classes provide static Encode and Decode methods for common formats.
var raw := 'Hello World';
var b64 := Base64Encoder.Encode(raw);
PrintLn('Base64: ' + b64);
var hex := HexadecimalEncoder.Encode(raw);
PrintLn('Hex: ' + hex); Base64: SGVsbG8gV29ybGQ= Hex: 48656c6c6f20576f726c64
Always use URLEncodedEncoder when building URLs with parameters.
var param := 'hello world & friends';
var encoded := URLEncodedEncoder.Encode(param);
PrintLn('URL Encoded: ' + encoded); URL Encoded: hello%20world%20%26%20friends
For a complete list of all supported encoding classes (including Base58, HTML, and XML), see the reference documentation: