From ae9124d3a92e2fd1d507d9dcba49209463391ad7 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Sun, 23 Nov 2008 10:00:13 -0500
Subject: [PATCH] Add fallback to default_charset when importing vcards

---
 program/include/rcube_vcard.php |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/program/include/rcube_vcard.php b/program/include/rcube_vcard.php
index 412582d..3179766 100644
--- a/program/include/rcube_vcard.php
+++ b/program/include/rcube_vcard.php
@@ -416,7 +416,7 @@
       'ISO-8859-10', 'ISO-8859-13', 'ISO-8859-14', 'ISO-8859-15', 'ISO-8859-16',
       'WINDOWS-1252', 'WINDOWS-1251', 'BIG5', 'GB2312');
 
-    if (function_exists('mb_detect_encoding') && ($enc = mb_detect_encoding($string, join(',', $encodings))))
+    if (function_exists('mb_detect_encoding') && ($enc = mb_detect_encoding($string, $encodings)))
       return $enc;
 
     // No match, check for UTF-8
@@ -433,7 +433,7 @@
         )*\z/xs', substr($string, 0, 2048)))
       return 'UTF-8';
 
-    return 'ISO-8859-1'; # fallback to Latin-1
+    return rcmail::get_instance()->config->get('default_charset', 'ISO-8859-1'); # fallback to Latin-1
   }
 
 }

--
Gitblit v1.9.1