note 44843 added to function.utf8-encode
| From: | steven-at-acko-dot-net at osu1 dot php dot net | Date: | Tue, 17 Aug 2004 21:45:52 +0000 |
| Subject: | note 44843 added to function.utf8-encode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-74837@lists.php.net to get a copy of this message | ||
Note that you should only use utf8_encode() on ISO-8859-1 data, and not on data using the
Windows-1252 codepage. Microsoft's Windows-1252 codepage contains ISO-8859-1, but it includes
several characters in the range 0x80-0x9F whose codepoints in Unicode do not match the byte's
value (in Unicode, codepoints U+80 - U+9F are unassigned).
utf8_encode() simply assumes the bytes integer value is the codepoint number in Unicode.
E.g. in 1252, byte 0x80 is the euro sign, which is U+20AC. The same goes for curly quotes, em
dashes, etc.
utf8_encode() will convert 0x80 into U+0080 (an unassigned codepoint) rather than U+20AC.
To convert 1252 to UTF-8, use iconv, recode or mbstring.
----
Manual Page -- http://www.php.net/manual/en/function.utf8-encode.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+44843
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44843&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44843&report=yes
Search -- http://master.php.net/manage/user-notes.php