summaryrefslogtreecommitdiff
path: root/program/include/rcube_vcard.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-10-03 08:05:59 +0000
committeralecpl <alec@alec.pl>2008-10-03 08:05:59 +0000
commitabdc5898b6f2ae39a48afbb464f296419e8ac646 (patch)
treed0c68711db572edba76e595ba095e91fc9ec6f29 /program/include/rcube_vcard.php
parent0bfbe62ab048477632013fd15d4d45bc20f67ede (diff)
- Add support for SJIS, GB2312, BIG5 in rc_detect_encoding()
- Fix vCard file encoding detection for non-UTF-8 strings (#1485410)
Diffstat (limited to 'program/include/rcube_vcard.php')
-rw-r--r--program/include/rcube_vcard.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/program/include/rcube_vcard.php b/program/include/rcube_vcard.php
index 8cc390c7a..ca7ca0822 100644
--- a/program/include/rcube_vcard.php
+++ b/program/include/rcube_vcard.php
@@ -396,6 +396,9 @@ class rcube_vcard
if (substr($string, 0, 2) == "\xFF\xFE") return 'UTF-16LE'; // Little Endian
if (substr($string, 0, 3) == "\xEF\xBB\xBF") return 'UTF-8';
+ if ($enc = rc_detect_encoding($string))
+ return $enc;
+
// No match, check for UTF-8
// from http://w3.org/International/questions/qa-forms-utf-8.html
if (preg_match('/\A(