Issue 1126 In vCard, escape comma not colon

git-svn-id: https://zxing.googlecode.com/svn/trunk@2120 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2012-01-19 09:30:26 +00:00
parent 420e47efd1
commit 035320bd2f
2 changed files with 2 additions and 2 deletions

View file

@ -27,7 +27,7 @@ import java.util.regex.Pattern;
*/
final class VCardContactEncoder extends ContactEncoder {
private static final Pattern RESERVED_VCARD_CHARS = Pattern.compile("([\\\\:;])");
private static final Pattern RESERVED_VCARD_CHARS = Pattern.compile("([\\\\,;])");
private static final Pattern NEWLINE = Pattern.compile("\\n");
private static final Formatter VCARD_FIELD_FORMATTER = new Formatter() {
@Override

View file

@ -129,7 +129,7 @@ public final class ContactInfoGenerator implements GeneratorSource {
private static void maybeAppendvCard(StringBuilder output, String prefix, String value) {
if (value.length() > 0) {
value = value.replaceAll("([\\\\:;])", "\\\\$1");
value = value.replaceAll("([\\\\,;])", "\\\\$1");
value = value.replaceAll("\\n", "\\\\n");
output.append(prefix).append(':').append(value).append('\n');
}