Re: Getting right character-set from MySQL
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: Getting right character-set from MySQL

From: Andy Hassall <andy@andyh.co.uk>
Date: Sun Sep 11 2005 - 18:05:23 CEST

On Sun, 11 Sep 2005 16:19:32 +0200, "Trpčić Ivan" <ivan.trpcic@kc.t-com.hr>
wrote:

>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
>database.

 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 :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Received on Mon Oct 24 02:09:56 2005