Character sets conversion functionality
package |
Framework |
---|---|
subpackage |
Core |
author |
Thomas Bruederli |
author |
Aleksander Machniak |
author |
Edmund Grimley Evans |
error_handler($errno, $errstr)
parse_charset(string $input) : string
Sometimes charset string is malformed, there are also charset aliases but we need strict names for charset conversion (specially utf8 class)
string
Input charset name
string
The validated charset name
convert($str, $from, $to = null) : string
Uses mbstring and iconv functions if possible
string
Converted string
utf7_to_utf8($str) : string
string
Converted string (UTF-8)
utf16_to_utf8($str) : string
string
The converted string
utf7imap_to_utf8(string $str) : string
If input data is invalid, return the original input string. RFC 2060 obviously intends the encoding to be unique (see point 5 in section 5.1.3), so we reject any non-canonical form, such as &ACY- (instead of &-) or &AMA-&AMA- (instead of &AMAAwA-).
Translated from C to PHP by Thomas Bruederli
string
Input string (UTF7-IMAP)
string
Output string (UTF-8)
utf8_to_utf7imap(string $str) : string
Unicode characters above U+FFFF are replaced by U+FFFE. If input data is invalid, return an empty string.
Translated from C to PHP by Thomas Bruederli
string
Input string (UTF-8)
string
Output string (UTF7-IMAP)
detect(string $string, string $failover = null, string $language = null) : string
string
String
string
Default result for failover
string
User language
string
Charset name
clean(mixed $input) : mixed
mixed
String or array.
mixed
String or array
aliases :