This is a discussion on Character encoding problems (command line vs browser) within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I've got a table in MySql (table, database, server, and connection all using iso-8859-1) with some accented ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I've got a table in MySql (table, database, server, and connection all
using iso-8859-1) with some accented characters. When I try to display these in a web browser, they come out incorrectly. But running PHP from the command line I have no such problems. I also see the accents correctly from the MySql client. There is no HTML issue, because I've reverted to text/plain for the purposes of troubleshooting. I'm not sure how this will come out for those of you using text-only newsreaders, but this is what I'm seeing: Command Line: ALLÉE Allée ÎLE Île ÉCH Échangeur Browser: ALLE All,e ×LE ×le CH changeur This is the code, nothing more than a straight database dump: <?php $link=new mysqli(....); $result=$link->query ('select * from street_types'); header('Content-Type:text/plain'); while ($row=$result->fetch_row()){ echo "$row[0] $row[1]\n"; } ?> Has anyone seen this before? Any ideas how to fix it? Thanks! |