Hi Congwu,

Thanks for the research, I missed that bit about the empty line. I'll add it in vCard 2.1 generation to be more conformant. On the other hand, I still would not want to leave out the folding spaces. With the reference to MIME RFC 1521, vCard 2.1 mandates parsers to ignore the spaces:

(Near the end of 5.2 "Base64 Content-Transfer-Encoding" in rfc1521)
Any characters outside of the base64 alphabet are to be ignored in base64-encoded data. The same applies to any illegal sequence of characters in the base64 encoding, such as "====="

Which means that our output, once the empty line is added, is fully conformant with the specs.

I haven't come across phones that crash on b64 folding spaces as mobical apparently did. Can we find out more about which ones this applies to? I know of phones that crash on any folding (Moto V3 and Razr), but for these we have <nocontentfolding>.

On the parsing side, the the patch I added today (see previous email) will work with or without that empty line.

Best Regards,

Lukas Zeller

On Oct 14, 2009, at 10:56 , Chen, Congwu wrote:

Thanks for the detailed story.
I found in vCard 2.1 spec:
base64          = <MIME RFC 1521 base64 text>
        ; the end of the text is marked with two CRLF sequences
        ; this results in one blank line before the start of the next
I was thinking we can detect end of b64 string by two consecutive CRLFs,
What's the potential problem?

For parsing, detection of the end of the B64 block requires lookahead
because there is no guarantee the b64 string ends in a "=" (it does
not when the input string is a integer multiple of 3 bytes). If we
can't distinguish folding line ends from end-of-property line ends,
the only solution is to parse ahead into the next line and check if
there's a colon as a sign that the entire line does not belong to the
B64 string.

Thanks,
Chen,Congwu

Lukas Zeller ([email protected])
-
Synthesis AG, SyncML Solutions  & Sustainable Software Concepts
[email protected], http://www.synthesis.ch





_______________________________________________
os-libsynthesis mailing list
[email protected]
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis

Reply via email to