By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,341 Members | 1,693 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,341 IT Pros & Developers. It's quick & easy.

PHP / PEAR & MySQL encoding

P: 1
I am having problem decoding data which is imported into a MySQL 4.0.* DB (thus no UTF-8 character set encoding possible)

Basically my application utilises PEAR for DB abstraction.

I import data from an EXCEL file directly into the DB. The data is imported correctly, i.e. I do not want it encoded in the DB. I want it imported directly with the special characters intact. So remains !

When I retrieve the Data it is not displaying the correctly. As far as I can tell this is caused by the select (via PEAR) returning the default character set from the DB, which in this case is latin1 (is this so?).

If this is the case how can I be sure that the characters are encode and displayed correctly via the browser? I have tried to set the character set in the HTML Content-Typ tag and in the forms utilised, but it doesn't always work.

Is there a way of ensuing that the Data in a MySQL 4.0.* DB is and remains UTF-8 encoded?

I have tried decoding it when I retrieve it using a convert character set class but that tends to throw up a time out if there is a lot of data returned.

My HTML encoding is set to UTF-8. Even if I change this to western european it doesn't help.

Help much appreciated!
Jul 20 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.