Voting

: zero plus nine?
(Example: nine)

The Note You're Voting On

phpnet at dariosulser dot ch
4 years ago
ANSI = Windows-1252 = CP1252
So UTF-8 -> ANSI:

<?php
$string
= "Winkel γ=200 für 1€"; //"γ"=HTML:&gamma;
$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)

<< Back to user notes page

To Top