Issue #842: allow + in MECARD TEL lines

This commit is contained in:
Sean Owen 2017-08-16 12:29:57 +01:00
parent e2afb336e2
commit cbdf087933

View file

@ -79,10 +79,10 @@ final class MECARDContactEncoder extends ContactEncoder {
}
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
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("");
}
}