question about database field-types and special characters

From: Date: Fri, 15 Feb 2008 02:47:59 +0000
Subject: question about database field-types and special characters
Groups: php.general 
Request: Send a blank email to php-general+get-269349@lists.php.net to get a copy of this message
I've got a PHP application that pulls in data from a mySQL database. The data is a series of wine producers, and many of them have special foreign characters over the a's and o's. When I go and view the data from my database using myPHPAdmin, the characters look fine, but when I pull the data into my web-page the special characters get messed up. For whatever reason, when I first set up the database, someone told me to preserve special characters by setting my collation for the wine-producer field to "latin1_swedish_ci". The data seems to be in there ok, so at least that works. Should I have used utf-8 instead? Can I set something in the doctype or header of my web-page to make it so that my website displays latin1_swedish_ci-based characters properly, or should I change my database field-type to be something different? My main fear is messing up the database (I'll back up first if I have to chance the field collation)

« previous php.general (#269349) next »