Parent: d882e5c6ca4a8b5c270a31b7a9c0830dc8a8df13
Author: Rafal Michalski <michalski.raf@gmail.com>
Committer: Marcel Holtmann <marcel@holtmann.org>
Date: 2012-12-04 23:48:45
Tree: b27ee46c58212a82616b0cd108521df82dd37ae8
obexd: Support for Quoted Printable encoding According to vCard 2.1 specification, this patch provides Quoted Printable encoding (described in RFC1521 document), which is specific for vCard 2.1 formatting and should be preferable for instance, if vcard's property field contains multiple lines (vCard's 2.1 spec. says: Multiple lines of formatted text are separated with a Quoted Printable CRLF sequence of "=0D" followed by "=0A" followed by a Quoted Printable softline break sequence of "="). In general all characters can be replaced with "=<Hex>" where "<Hex>" is the 2-character hexadecimal representation of the character's decimal value. Characters with decimal values of 33 through 60 inclusive, and 62 through 126, inclusive, may be represented as the ASCII characters. Quoted Printable lines of text must also be limited to less than 76 characters. For longer lines soft line breaks must be used - an equal sign as the last character on a encoded line indicates such soft line break in the encoded text. In this case, Quoted Printable is selected, if vCard's 2.1 field contains newline character or some specific ASCII character from set: '!', '"', '#', '$', '@', '[', '\', ']', '^', '`', '{', '|', '}', '~'. (it is not mandatory but each character from this set will be encoded as Quoted Printable spec. suggests). Equal sign character in vCard's field is always encoded (it is mandatory and Quoted Printable encoding is taken into account if this character present in vCard's field) since it is special character used for encoding characters and indicating soft line breaks. Horizontal tab and space characters are always encoded. It's mandatory only if they are not followed by any other character. Always encoding makes simplification, since we don't need to care about position of these characters. According to vCard 2.1 specification semicolon character, present in vCard's field, must be escaped with backslash character. Since backslash is always encoded it gives sequence "=5C;" (instead of "\;").
Diffstat
| M | obexd/plugins/vcard.c | | | 199 | ++++++++++++++++++++++++++++++++++++++++- - - |
1 files changed, 196 insertions(+), 3 deletions(-)