summaryrefslogtreecommitdiffstats
path: root/apps/contacts/lib/vcard.php
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-06-12 12:31:28 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-06-12 12:33:37 +0200
commitcee9d400c0192325c23304770184e95dd817147a (patch)
tree873068135b252c79d23b3e944f311167bf3ad326 /apps/contacts/lib/vcard.php
parentb70226b49370aaeed1e3551b0f0ffd0d100be907 (diff)
downloadnextcloud-server-cee9d400c0192325c23304770184e95dd817147a.tar.gz
nextcloud-server-cee9d400c0192325c23304770184e95dd817147a.zip
Contacts: Final (for now) fix to encoding probs on import.
Diffstat (limited to 'apps/contacts/lib/vcard.php')
-rw-r--r--apps/contacts/lib/vcard.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/contacts/lib/vcard.php b/apps/contacts/lib/vcard.php
index 168e8af3e55..71a874d783b 100644
--- a/apps/contacts/lib/vcard.php
+++ b/apps/contacts/lib/vcard.php
@@ -131,7 +131,7 @@ class OC_Contacts_VCard{
foreach($property->parameters as $key=>&$parameter){
if(strtoupper($parameter->name) == 'ENCODING') {
if(strtoupper($parameter->value) == 'QUOTED-PRINTABLE') { // what kind of other encodings could be used?
- $property->value = str_replace("\r\n", "\n", mb_convert_encoding(quoted_printable_decode($property->value), 'utf-8', 'auto'));
+ $property->value = quoted_printable_decode($property->value);
unset($property->parameters[$key]);
}
} elseif(strtoupper($parameter->name) == 'CHARSET') {
@@ -188,6 +188,7 @@ class OC_Contacts_VCard{
if($upgrade && in_array($property->name, $stringprops)) {
self::decodeProperty($property);
}
+ $property->value = str_replace("\r\n", "\n", iconv(mb_detect_encoding($property->value, 'UTF-8, ISO-8859-1'), 'utf-8', $property->value));
if(in_array($property->name, $stringprops)) {
$property->value = strip_tags($property->value);
}