[Top] [All Lists]

Re: 'header' test and whitespace

2005-11-22 10:50:32

Ned says...
So, there are three choices:
1) just compress whitespace at fold points
2) compress all whitespace
3) no compression

I strongly object to (1) and (2). Making the header test not respect interior
spaces is a _really_ bad idea. Like it or not, there are communities that are
very sensitive to spacing issues (many Japanese users seem to qualify) and
these communites need to be able to test and see exactly what sorts of spaces
are present in fields (and possibly modify them).

I proposed (1), and am not fond of (2); given Ned's statement and the comments
from Michael and Kjetil, I think it's clear that (2) is out.

I have no problem with removing whitespace at the beginning of the field - in
fact I prefer it. I think removing trailing whitespace has a chance of causing
problems, but the benefits probably equal if not exceed the costs.

I agree.
But the same reasoning is why I suggested (1).  See Michael's comment:

> Both UCB mail and mutt do compress whitespace at fold points for the
> overview and show all whitespace at fold points when displaying the
> message, including the newline.  Both surprises me, and I do not like it.

It's that inconsistency that prompts this suggestion.  Behaviour is so varied
that I'd rather see us define something predictable.

That said, there's Kjetil's comment:

> so I don't think it matters much in practice.  so my conclusion is:
> don't confuse matters even more by adding Sieve specific unfolding
> rules.

There's definitely something to be said for us to just point to the RFC2822
unfolding rule, and not define our own.

I'll be happy with whatever decision we make about the whitespace at the fold
points, but I prefer compressing it to one space there.  I will NOT be happy
if we don't strip leading and trailing whitespace on the overall unfolded
field value.  Moreover, I think another important point in what I suggested
is that this stripping be done ANY TIME Sieve touches a header field value,
NOT JUST IN COMPARISONS.  If we stick the value into a variable and then
compare against the variable, the behaviour must be the same as if we
compare against the header field value directly, which means that the
leading and trailing whitespace must be stripped when the value is put into
the variable in the first place.


Barry Leiba, Pervasive Computing Technology