Hello,

I have a problem with displaying special slovenian letters.

1) I set up in MySQL database charset to utf8, and collate to ut8_general_ci.

2) In my php files which 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) I use phpedit for editing my php files and I set charset to EastEuropean to be able to type special slovenian letters.

4) And finally, I put next code at the beggining of my php files:

header("Content-Type: 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.

Whatever I tried, I could't get everything displayed properly.

Anyone can help, please?

Tnx in advance,
Nati

Recommended Answers

All 3 Replies

You need to set the charset in your editor to UTF-8, not East European. Remember that unicode supports all characters, so those special slovanian letters should still work.

Hello,

I'm using PHP Edit which has no option to set charset to UTF8. Obviously I need some other editor, do you have any suggestion? For free one :)


Regards,
Nati

Try geany (avaliable for windows and linux). Don't know if it has as much features as PHP edit, but it has syntax highlighting, tabs, and auto-tabbing which is good enough for me.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.