Jump to content

Recommended Posts

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

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/202987-utf-8/
Share on other sites

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)

Link to comment
https://forums.phpfreaks.com/topic/202987-utf-8/#findComment-1063709
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/202987-utf-8/#findComment-1063724
Share on other sites

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;

Link to comment
https://forums.phpfreaks.com/topic/202987-utf-8/#findComment-1063732
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.