Jump to content

Problem with charset


nati

Recommended Posts

Hello,

 

I have problem with charset for serbian letters. This subject was discussed many times, but even after I used the code other suggested, special letters are still problematic.

 

The situation is next:

 

1) I have MySQL database, charset is set to utf8, collate is set to ut8_general_ci.

 

2) In my php files witch communicate to database, I put next code:

 

mysql_query('SET CHARACTER SET utf8', $db);

mysql_query('SET NAMES utf8', $db);

 

mysql_connect is stored in $db.

 

3) Also, I put in meta tags next code:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

 

Now, I have 2 results, depending on Internet Explorer encoding. If encoding is UTF8, I can see special letters in data retreived from database properly, but in ordinary text on page I'm getting questionmarks instead of special letters.

When I put Central European encoding in IE, situation is opposite, ordinary text is ok, but data retrieved from database have wierd symbols.

 

Anyone has an idea how to solve this, please?

 

Tnx in advance,

Nati

Link to comment
https://forums.phpfreaks.com/topic/127019-problem-with-charset/
Share on other sites

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.