mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
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:
parent
420e47efd1
commit
035320bd2f
|
@ -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
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue