Jump to content

problem with latin chars in mysql/php output


UnknownPlayer

Recommended Posts

I have problem with latin characters čćšđž, when i read from mysql and echo them in table, it show me like this:

20110609003815.png

 

Pe�kiri is im mysql Peškiri...

btw i put in my header.php, which i include, this line: <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

 

What is problem?

Whats the character encoding of your database table? Are you sure your PHP file is UTF-8, just just the meta tag?

 

Also, check the raw HTML and see what's being outputted.

 

A solution without knowing the above would be to htmlentity() before you insert into the database.

I fond difference when you add something in mysql qith mysql INSERT command from php, and when you add from phpmyadmin.

Resilts are:

20110611034611.png

This is inserted from phpmyadmin, with this characters, and this does not work when i read them from mysql.

 

But this is when i insert some text in mysql with php/mysql comman INSERT:

20110611034625.png

This option works..

 

But how can i read items from first image, and echo them but to work ?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.