encoding - How to print a list of all ascii characters with php? -
i'm traying print ascii characters when index arrives extended characters appears question mark �. see image
for example, if echo chr(160);
oa==
when supposed á
how can correct value without change header charset or file encoding?
im doing follow:
for ($i=0; $i < 255; $i++) { echo chr($i) . " - "; }
my file encoded utf-8. when set header iso-8859-1 appears good. see image
header("content-type: text/html; charset=iso-8859-1");
you convert characters utf-8:
for ($i=0; $i < 255; $i++) { echo mb_convert_encoding (chr($i), 'utf-8', 'iso-8859-1') . " - "; }
Comments
Post a Comment