}
public static AddressBookParsedResult parse(Result result) {
+ // Although we should insist on the raw text ending with "END:VCARD", there's no reason
+ // to throw out everything else we parsed just because this was omitted. In fact, Eclair
+ // is doing just that, and we can't parse its contacts without this leniency.
String rawText = result.getText();
- if (rawText == null || !rawText.startsWith("BEGIN:VCARD") || !rawText.endsWith("END:VCARD")) {
+ if (rawText == null || !rawText.startsWith("BEGIN:VCARD")) {
return null;
}
String[] names = matchVCardPrefixedField("FN", rawText, true);
start = end + 1;
}
components[componentIndex] = name.substring(start);
- StringBuffer newName = new StringBuffer();
+ StringBuffer newName = new StringBuffer(100);
maybeAppendComponent(components, 3, newName);
maybeAppendComponent(components, 1, newName);
maybeAppendComponent(components, 2, newName);