diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-10-01 13:45:39 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-10-01 13:45:39 +0000 |
commit | 27b50ef542bd8673eda1f72262c29d42eb9947fd (patch) | |
tree | db9a9fe0fbd4d2b513891a9dd87bda2d87dbe227 /includes/unicode.inc | |
parent | c267c749e7b6d1842409d07797792fde2b9ef5f3 (diff) | |
download | brdo-27b50ef542bd8673eda1f72262c29d42eb9947fd.tar.gz brdo-27b50ef542bd8673eda1f72262c29d42eb9947fd.tar.bz2 |
- Revert. Was already committed.
Diffstat (limited to 'includes/unicode.inc')
-rw-r--r-- | includes/unicode.inc | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/includes/unicode.inc b/includes/unicode.inc index 80ea87714..04751ed79 100644 --- a/includes/unicode.inc +++ b/includes/unicode.inc @@ -259,31 +259,6 @@ function _mime_header_decode($matches) { } /** - * Complement to mime_header_encode - */ -function mime_header_decode($header) { - // First step: encoded chunks followed by other encoded chunks (need to collapse whitespace) - $header = preg_replace_callback('/=\?([^?]+)\?(Q|B)\?([^?]+|\?(?!=))\?=\s+(?==\?)/', '_mime_header_decode', $header); - // Second step: remaining chunks (do not collapse whitespace) - return preg_replace_callback('/=\?([^?]+)\?(Q|B)\?([^?]+|\?(?!=))\?=/', '_mime_header_decode', $header); -} - -/** - * Helper function to mime_header_decode - */ -function _mime_header_decode($matches) { - // Regexp groups: - // 1: Character set name - // 2: Escaping method (Q or B) - // 3: Encoded data - $data = ($matches[2] == 'B') ? base64_decode($matches[3]) : str_replace('_', ' ', quoted_printable_decode($matches[3])); - if (strtolower($matches[1]) != 'utf-8') { - $data = drupal_convert_to_utf8($data, $matches[1]); - } - return $data; -} - -/** * Decode all HTML entities (including numerical ones) to regular UTF-8 bytes. * Double-escaped entities will only be decoded once ("&lt;" becomes "<", not "<"). * |