Encoding¶
Import: import system.encoding;
Encoding¶
UTF-8 / hex / Base64 encode and decode helpers.
utf8_encode¶
Copies the UTF-8 encoding of text into a new byte[].
utf8_decode¶
Interprets bytes as UTF-8 and builds a Dream string.
hex_encode¶
Encodes bytes as lowercase hexadecimal text.
hex_decode¶
Decodes hexadecimal text into bytes; rejects odd length and non-hex digits.
base64_encode¶
Encodes bytes as standard Base64 (with = padding).
base64_decode¶
Decodes Base64 text (whitespace ignored); rejects invalid alphabet characters.
base64url_encode¶
Encodes bytes as Base64url without padding.
base64url_decode¶
Decodes Base64url text (-/_, padding optional).
uri_encode_component¶
Percent-encodes text as UTF-8 bytes (RFC 3986 unreserved set left as-is).
uri_decode_component¶
Decodes percent escapes as strict UTF-8, preserving literal +. Malformed escapes or invalid UTF-8 return a parse error.
form_encode_component¶
Encodes a form component as UTF-8, using + for spaces and percent escapes except for ASCII letters, digits, *, -, ., and _.
form_decode_component¶
Decodes a form component, interpreting + as space and validating escaped UTF-8. Malformed escapes or invalid UTF-8 return a parse error.