note 124205 added to function.iconv
| From: | phpnet at dariosulser dot ch | Date: | Wed, 18 Sep 2019 13:12:51 +0000 |
| Subject: | note 124205 added to function.iconv | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-212242@lists.php.net to get a copy of this message | ||
ANSI = Windows-1252 = CP1252
So UTF-8 -> ANSI:
<?php
$string = "Winkel γ=200 für 1â¬"; //"γ"=HTML:γ
$result = iconv('UTF-8', 'CP1252//IGNORE', $string);
echo $result;
?>
Note1
<?php
$string = "Winkel γ=200 für 1â¬";
$result = iconv('UTF-8', 'CP1252', $string);
echo $result; //"conv(): Detected an illegal character in input string"
?>
Note2 (ANSI is better than decode in ISO 8859-1 (ISO-8859-1==Latin-1)
<?php
$string = "Winkel γ=200 für 1â¬";
$result = utf8_decode($string);
echo $result; //"Winkel ?=200 für 1?"
?>
Note3 of used languages on Websites:
93.0% = UTF-8;
3.5% = Latin-1;
0.6% = ANSI <----- you shoud use (or utf-8 if your page is in Chinese or has Maths)
----
Server IP: 208.43.231.9
Probable Submitter: 185.85.3.168 (proxied: 2a02:120b:2c0e:f2c0:314f:e230:ecab:2fbe)
----
Manual Page -- http://php.net/manual/en/function.iconv.php
Edit -- https://master.php.net/note/edit/124205
Del: integrated -- https://master.php.net/note/delete/124205/integrated
Del: useless -- https://master.php.net/note/delete/124205/useless
Del: bad code -- https://master.php.net/note/delete/124205/bad+code
Del: spam -- https://master.php.net/note/delete/124205/spam
Del: non-english -- https://master.php.net/note/delete/124205/non-english
Del: in docs -- https://master.php.net/note/delete/124205/in+docs
Del: other reasons-- https://master.php.net/note/delete/124205
Reject -- https://master.php.net/note/reject/124205
Search -- https://master.php.net/manage/user-notes.php