utf8_encode()
utf8_encode - Encodes an ISO-8859-1 string to UTF-8
Syntax
string utf8_encode (
string $data)
Arguments
- data - An ISO-8859-1 string.
Description
This function encodes the string data to UTF-8, and returns the encoded version. UTF-8is a standard mechanism used by Unicodefor encoding wide charactervalues into a byte stream. UTF-8is transparent to plain ASCIIcharacters, is self-synchronized (meaning it is possible for a program to figure out where in the bytestream characters start) and can be used with normal string comparison functions for sorting and such. PHP encodes UTF-8characters in up to four bytes, like this: UTF-8 encoding bytes bits representation 1 7 0bbbbbbb 2 11 110bbbbb 10bbbbbb 3 16 1110bbbb 10bbbbbb 10bbbbbb 4 21 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb Each brepresents a bit that can be used to store character data.
Version
PHP 4, 5
Return value
Returns the UTF-8 translation of data.