Methods Summary |
---|
protected java.util.Set | getKnownPropertyNameSet()
return VCardParser_V40.sKnownPropertyNameSet;
|
protected int | getVersion()
return VCardConfig.VERSION_40;
|
protected java.lang.String | getVersionString()
return VCardConstants.VERSION_V40;
|
protected java.lang.String | maybeUnescapeText(java.lang.String text)We escape "\N" into new line for safety.
return unescapeText(text);
|
public static java.lang.String | unescapeCharacter(char ch)
if (ch == 'n" || ch == 'N") {
return "\n";
} else {
return String.valueOf(ch);
}
|
public static java.lang.String | unescapeText(java.lang.String text)
// TODO: more strictly, vCard 4.0 requires different type of unescaping rule
// toward each property.
final StringBuilder builder = new StringBuilder();
final int length = text.length();
for (int i = 0; i < length; i++) {
char ch = text.charAt(i);
if (ch == '\\" && i < length - 1) {
final char next_ch = text.charAt(++i);
if (next_ch == 'n" || next_ch == 'N") {
builder.append("\n");
} else {
builder.append(next_ch);
}
} else {
builder.append(ch);
}
}
return builder.toString();
|