View Single Post

   
  #2 (permalink)  
Old 02-28-2008, 08:14 AM
Axel Schwenke
 
Posts: n/a
Default Re: Charset driving me crazy!

correo@ironcito.com wrote:
>
> This is driving me crazy. I use php to query MySQL.


What MySQL version do you use? What is the (default) character set
(and collation) at server/database/table/column level?

Which PHP extension do you use to connect to MySQL? The old 'mysql'
extension does not know about character sets. Maybe you would like
to switch to the (newer, better, bigger) 'mysqli' extension.

> Then the results are displayed on a webpage.


Do you set a 'content-type' header with character set information?
What encoding do you use to store the data?

> All accented characters, umlauts, etc. are
> displayed incorrectly on the webpage.


> both phpMyAdmin and Navicat say that ALL
> charsets are set to UTF8 at the server, database and table level.


What does the database say (SHOW VARIABLES LIKE 'char%', SHOW CREATE
TABLE ..., SHOW CREATE DATABASE ...)? More important - does your
MySQL client specify a connection character set?

Last not least: have you read the chapter on character set and
collation support in MySQL?


Fast recipe to avoid character set problems:

1. store all strings in UTF8 encoding
2. connect to the database with UTF8 connection setting
3. emit a content-type header specifying UTF8 encoding


XL
Reply With Quote