| | |
Problem with encoding
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2008
Posts: 2
Reputation:
Solved Threads: 0
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
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
![]() |
Similar Threads
- Internet Explorer SP2 Encoding Error (Web Browsers)
- Page/Character Encoding Tips (PHP)
- dot prn encoding problem (PHP)
- Qestion on Encoding and Decoding. (Python)
- dreamweaver problem with language (Site Layout and Usability)
- problem reading xml file in c# (C#)
- IE causing problem with Win Explorer Display (Web Browsers)
- Encoding (Unicode) problem in IE 6.0 (Web Browsers)
Other Threads in the PHP Forum
- Previous Thread: How to create a scrapbook in php+mysql
- Next Thread: Can an 'automatic timer' be done in php?
Views: 536 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email encode error file files folder form forms function functions google howtowriteathesis href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail menu methods mlm mod_rewrite multiple multipletables mysql oop parse paypal pdf php problem provider query radio random recursion regex remote script search select server sessions sms soap source space speed sql structure syntax system table template tutorial update updates upload url validation validator variable video web xml youtube






