note 76434 added to function.utf8-decode
| From: | ludvigdotericsonatgmaildotcom at osu1 dot php dot net | Date: | Sun, 15 Jul 2007 17:52:22 +0000 |
| Subject: | note 76434 added to function.utf8-decode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-128599@lists.php.net to get a copy of this message | ||
A better way to convert would be to use iconv, see http://www.php.net/iconv -- example:
<?php
$myUnicodeString = "Ã
äö";
echo iconv("UTF-8", "ISO-8859-1", $myUnicodeString);
?>
Above would echo out the given variable in ISO-8859-1 encoding, you may replace it with whatever you
prefer.
Another solution to the issue of misdisplayed glyphs is to simply send the document as UTF-8, and of
course send UTF-8 data:
<?php
# Replace text/html with whatever MIME-type you prefer.
header("Content-Type: text/html; charset=utf-8");
?>
----
Server IP: 212.63.193.10
Probable Submitter: 80.217.189.62
----
Manual Page -- http://www.php.net/manual/en/function.utf8-decode.php
Edit -- https://master.php.net/note/edit/76434
Del: integrated -- https://master.php.net/note/delete/76434/integrated
Del: useless -- https://master.php.net/note/delete/76434/useless
Del: bad code -- https://master.php.net/note/delete/76434/bad+code
Del: spam -- https://master.php.net/note/delete/76434/spam
Del: non-english -- https://master.php.net/note/delete/76434/non-english
Del: in docs -- https://master.php.net/note/delete/76434/in+docs
Del: other reasons-- https://master.php.net/note/delete/76434
Reject -- https://master.php.net/note/reject/76434
Search -- https://master.php.net/manage/user-notes.php