[Top] [All Lists]

Re: Proposal for escaping on non-UTF-8 sequences in Sieve

2006-09-18 13:42:26

On Mon, Sep 18, 2006 at 09:44:20AM -0700, Ned Freed wrote:
There are all sorts of ways to do it. Here's an obvious one: If the
octet-value extension is enabled, any occurances of ${x} where x takes
the form of a space-separated list of decimal values is replaced with
a sequence of octets corresponding to each value.

What a brilliant idea! How about using the same syntax variables do,
and embedding arbitrary data written as a function?

  "${dec:222 173 190 239}"

Exim string operators work that way.  I didn't follow the variables
extension too close, because I consider it to be too expensive for my
needs.  If there are string operators already, adapt the above as needed,
but it would be both extensible and easier to read than backslash quoting.
If needed, someone could add "${from_base64:}".

If used without variables, the function would not expand its arguments
first, thus evaluate in linear time.  If used with variables, its argument
would be expanded first, like strings are expanded.