|
[PHP] UTF8 characters... April 05, 2007 05:53PM |
Registered: 6 years ago Posts: 13 |
Commander,
I am sorry for bothering you with a question not immediately related to HtmlPurifier, but I think you are the only one able to help me.
I have decided to convert my DB to UTF8 following your guidelines. Now, I restored the database, and when I see it in phpmyadmin, all looks fine. I can see and search for special characters.
Anyhow, when I output the SAME fields in a php script (even just outputting them with echo after having retrieved them from the database), some of the special characters are replaced by question marks.
So while I can read this just fine in phpmyadmin "it is like a 360
|
Re: [PHP] UTF8 characters... April 05, 2007 05:57PM |
Admin Registered: 6 years ago Posts: 2,640 |
Have you set the connection encoding? Try executing this query before pulling data from the database:
SET NAMES utf8
I don't know if MySQL 5.0 needs this, but MySQL 4.1 definitely does.
HTML Purifier, Standards Compliant HTML Filtering
|
Re: [PHP] UTF8 characters... April 05, 2007 06:14PM |
Registered: 6 years ago Posts: 13 |
Wooooooah! You are the best, I knew you could help me.
I have been asking around in php channels, and nobody knew what could be causing this!
Thanks sir!
By the way, since I have just converted to UTF8, is there some way you can suggest to verify the database does not contain invalid characters (if this is possible at all!)?
Well, anyhow, thanks again! I have been fighting with this all day. It will be so much better to have a system where I do not have to use entities for everything!
|
Re: [PHP] UTF8 characters... April 05, 2007 06:56PM |
Admin Registered: 6 years ago Posts: 2,640 |
Happy to help.
Quote:By the way, since I have just converted to UTF8, is there some way you can suggest to verify the database does not contain invalid characters (if this is possible at all!)?
Hmm... I really don't know. Try asking some MySQL gurus about it. I, personally, wouldn't worry about it.
HTML Purifier, Standards Compliant HTML Filtering
|
Re: [PHP] UTF8 characters... April 06, 2007 01:18PM |
Registered: 6 years ago Posts: 43 |