Re: Event element encoding

Robert Leftwich <[email protected]> Tue, 23 Mar 2004 09:08:20 +1100
Newsgroups gmane.comp.web.mod-pubsub.devel
Message-ID <[email protected]>
At 08:34 AM 23/03/2004, Kragen Sitaker wrote:

>On Tue, Mar 23, 2004 at 07:25:35AM +1100, Robert Leftwich wrote:
> > and then uses the Python quopri.decode library function which
> > does things a little differently, i.e. it uses the 'Q' encoding which is
> > similar to "Quoted-Printable" but is different in significant areas, e.g.
> > it may represent spaces as underscores, according to the RFC it is 
> based on.
>
>quopri.decode only decodes underscores as spaces if an optional third
>argument is passed, at least in Python 2.2.2.

Sorry, my bad - the first coffee had obviously not hit the system when 
reading the Python doco!

>Are there other bugs?

We might run into problems with Rule 4 of  RFC 1521 which says "A line 
break in a text body, independent of what its representation is following 
the canonical representation of the data being encoded, must be represented 
by a (RFC 822) line break, which is a CRLF sequence...", but given the 
python server encodes \n it may not be an issue.

Similarly it's possible, although a little unlikely, that long event values 
may cause problems with rule 5 which says "the Quoted-Printable encoding 
REQUIRES  that encoded lines be no more than 76 characters long. If longer 
lines are to be encoded with the Quoted-Printable encoding, 'soft' line 
breaks must be used. An equal sign as the last character on a encoded line 
indicates such a non-significant ('soft') line break in the encoded text."

The fact that the mps spec only uses the QP 'style', not the QP spec itself 
is a possible source of problems, so using a qp decode function is probably 
not ideal. Although, the likelihood of it causing any problems appears to 
be pretty low, as evidenced by the fact that no-one is reporting any actual 
problems!

Do we keep the status quo and 'don't fix it if it ain't broke'?

As far as the Java client goes, I'm going with the (rewritten) protocol 
version by making sure it decodes any '=XX' occurrences.

All things going well I should have a useable release later today, but 
writing unit tests that cover all the edge cases is no small undertaking!

Robert


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.634 / Virus Database: 406 - Release Date: 18/03/2004