Getting right character-set from MySQL

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have created MySQL database on XP SP2 machine in cp1250 character-set, and  
loaded some data
in the same character-set. When I read table using EMS MySQL Managet 3 Lite,  
I get croatian characters displayed correctly, but when I show this data in  
php page, I get '?' instead of croatian characters.
I put <meta http-equiv="Content-Type"  
content="text/html;charset=windows-1250"> at the HEAD section of the page,  
and all text is displayed correcty, except those fetched from MySQL  
Can anybody help?  

Re: Getting right character-set from MySQL


Quoted text here. Click to load it

 Since you are using PHP you have control over what headers are sent, so you
can send the real header instead of an unreliable <meta> tag.

 header('Content-type: text/html;charset=windows-1250');

 Even if this doesn't help it at least eliminates one of the likely
possibilities, that the browser is using the wrong encoding.

Andy Hassall :: :: :: disk and FTP usage analysis tool

Site Timeline