ilikephp Posted July 12, 2009 Share Posted July 12, 2009 Hello!! Could somebody help me solve this problem? I am storing information in the database (using PHP MySQL) the arabic characters could not be read in MySQL, they are displayed in a strange language, How can they be displayed in arabic please. (I think it is related to UTF- Thanks in advance... Quote Link to comment https://forums.phpfreaks.com/topic/165705-solved-utf-8-in-mysql/ Share on other sites More sharing options...
Daniel0 Posted July 12, 2009 Share Posted July 12, 2009 You need to make sure you set the connection to utf8 as well. Also remember to send the correct header to the browser. Basically, make sure you use the same character set throughout the entire process from start to finish. Quote Link to comment https://forums.phpfreaks.com/topic/165705-solved-utf-8-in-mysql/#findComment-874250 Share on other sites More sharing options...
ilikephp Posted July 13, 2009 Author Share Posted July 13, 2009 Hi, thanks for your help!! Could you plz give me an example about how to add the utf8 to the connection? how to send the correct header to the browser? (Sorry but I am not expert in php) Thanks... Quote Link to comment https://forums.phpfreaks.com/topic/165705-solved-utf-8-in-mysql/#findComment-874571 Share on other sites More sharing options...
Daniel0 Posted July 13, 2009 Share Posted July 13, 2009 http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html http://php.net/manual/en/function.header.php http://www.ietf.org/rfc/rfc2616.txt Thus: header('Content-type: text/html; charset=utf-8'); And SET NAMES utf8; Quote Link to comment https://forums.phpfreaks.com/topic/165705-solved-utf-8-in-mysql/#findComment-874609 Share on other sites More sharing options...
ilikephp Posted July 13, 2009 Author Share Posted July 13, 2009 thx a lot!!! Quote Link to comment https://forums.phpfreaks.com/topic/165705-solved-utf-8-in-mysql/#findComment-874675 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.