parse quoted printable properly at importing contacts
This commit is contained in:
parent
991e4d1e75
commit
7acfde6bb0
|
@ -196,12 +196,17 @@ class VcfImporter(val activity: SimpleActivity) {
|
||||||
val type = getAddressTypeId(rawType.toUpperCase())
|
val type = getAddressTypeId(rawType.toUpperCase())
|
||||||
val addresses = addressParts[1].split(";")
|
val addresses = addressParts[1].split(";")
|
||||||
if (addresses.size == 7) {
|
if (addresses.size == 7) {
|
||||||
if (address.contains(";CHARSET=UTF-8:")) {
|
var parsedAddress = if (address.contains(";CHARSET=UTF-8:")) {
|
||||||
val fullAddress = TextUtils.join(", ", addresses.filter { it.trim().isNotEmpty() })
|
TextUtils.join(", ", addresses.filter { it.trim().isNotEmpty() })
|
||||||
curAddresses.add(Address(fullAddress, type))
|
|
||||||
} else {
|
} else {
|
||||||
curAddresses.add(Address(addresses[2].replace("\\n", "\n"), type))
|
addresses[2].replace("\\n", "\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (address.contains("QUOTED-PRINTABLE")) {
|
||||||
|
parsedAddress = QuotedPrintable.decode(parsedAddress)
|
||||||
|
}
|
||||||
|
|
||||||
|
curAddresses.add(Address(parsedAddress, type))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue