| | |
| | | | program/include/rcube_vcard.php | |
| | | | | |
| | | | This file is part of the RoundCube Webmail client | |
| | | | Copyright (C) 2008, RoundCube Dev. - Switzerland | |
| | | | Copyright (C) 2008-2009, RoundCube Dev. - Switzerland | |
| | | | Licensed under the GNU GPL | |
| | | | | |
| | | | PURPOSE: | |
| | |
| | | return $vcard; |
| | | } |
| | | |
| | | private static function rfc2425_fold_callback($matches) |
| | | { |
| | | return ":\n ".rtrim(chunk_split($matches[1], 72, "\n ")); |
| | | } |
| | | |
| | | private static function rfc2425_fold($val) |
| | | { |
| | | return preg_replace('/:([^\n]{72,})/e', '":\n ".rtrim(chunk_split("\\1", 72, "\n "))', $val) . "\n"; |
| | | return preg_replace_callback('/:([^\n]{72,})/', array('self', 'rfc2425_fold_callback'), $val) . "\n"; |
| | | } |
| | | |
| | | |
| | |
| | | '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 |
| | |
| | | )*\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 |
| | | } |
| | | |
| | | } |