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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Try when it's read and echo'ed. If that doesn't work, then it's not being stored correctly, so the easy solution would be to do it before you insert.

 

Don't forget to specify the third, charset parameter when using htmlentities()

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.