mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Issue #842: allow + in MECARD TEL lines
This commit is contained in:
parent
e2afb336e2
commit
cbdf087933
|
@ -79,10 +79,10 @@ final class MECARDContactEncoder extends ContactEncoder {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class MECARDTelDisplayFormatter implements Formatter {
|
private static class MECARDTelDisplayFormatter implements Formatter {
|
||||||
private static final Pattern NOT_DIGITS = Pattern.compile("[^0-9]+");
|
private static final Pattern NOT_DIGITS_OR_PLUS = Pattern.compile("[^0-9+]+");
|
||||||
@Override
|
@Override
|
||||||
public CharSequence format(CharSequence value, int index) {
|
public CharSequence format(CharSequence value, int index) {
|
||||||
return NOT_DIGITS.matcher(PhoneNumberUtils.formatNumber(value.toString())).replaceAll("");
|
return NOT_DIGITS_OR_PLUS.matcher(PhoneNumberUtils.formatNumber(value.toString())).replaceAll("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue