phpmady Posted May 26, 2010 Share Posted May 26, 2010 Hi, I am using <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> in all pages of my project, but am using ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; I am using arabic and english in my project, so shall whether its better to stay as it is or shall i change in db also Only recently i started to use utf-8 in all my html and php pages Thanks Quote Link to comment https://forums.phpfreaks.com/topic/202987-utf-8/ Share on other sites More sharing options...
premiso Posted May 26, 2010 Share Posted May 26, 2010 If you are using utf-8 charset you should change your DB to also use utf-8. The charset you want for the DB should be utf8_general_ci. Quote Link to comment https://forums.phpfreaks.com/topic/202987-utf-8/#findComment-1063680 Share on other sites More sharing options...
phpmady Posted May 26, 2010 Author Share Posted May 26, 2010 Thank you, I will be changing my charset to utf-8 in db also, thanks for your input, If you are using utf-8 charset you should change your DB to also use utf-8. The charset you want for the DB should be utf8_general_ci. Quote Link to comment https://forums.phpfreaks.com/topic/202987-utf-8/#findComment-1063690 Share on other sites More sharing options...
Mchl Posted May 26, 2010 Share Posted May 26, 2010 A few things to have in mind: 1. MySQL has table charset, which is used for all new columns if no other charset is specified, and also column charsets. Make sure you change column charsets as well. 2. Just changing a charset form latin1 to utf8 will not change encoding of the data. You might need to perform additional operation for that (but then, it might not be necessary at all, if you used utf8 connection encoding so far) Quote Link to comment https://forums.phpfreaks.com/topic/202987-utf-8/#findComment-1063709 Share on other sites More sharing options...
phpmady Posted May 26, 2010 Author Share Posted May 26, 2010 A few things to have in mind: 1. MySQL has table charset, which is used for all new columns if no other charset is specified, and also column charsets. Make sure you change column charsets as well. 2. Just changing a charset form latin1 to utf8 will not change encoding of the data. You might need to perform additional operation for that (but then, it might not be necessary at all, if you used utf8 connection encoding so far) Hi, CREATE TABLE IF NOT EXISTS `templates` ( `Template_ID` int(11) NOT NULL, `Template_Name` varchar(255) NOT NULL, `Template_Color` varchar(255) NOT NULL, PRIMARY KEY (`Template_ID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; Here in this template table charset is defined and you talked about column charsets what is that Thanks Quote Link to comment https://forums.phpfreaks.com/topic/202987-utf-8/#findComment-1063724 Share on other sites More sharing options...
Mchl Posted May 26, 2010 Share Posted May 26, 2010 In this example, there is no charset set for columns, so they use default latin1. However, you can specifu charset for individual columns like this: CREATE TABLE IF NOT EXISTS `templates` ( `Template_ID` int(11) NOT NULL, `Template_Name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `Template_Color` varchar(255) CHARACTER SET latin2 COLLATE latin2_bin NOT NULL, PRIMARY KEY (`Template_ID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; Quote Link to comment https://forums.phpfreaks.com/topic/202987-utf-8/#findComment-1063732 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.