开发者

Mysql why use utf8_slovenian_ci?

开发者 https://www.devze.com 2023-01-29 10:51 出处:网络
Some of mysql code I have been looking using utf8_slovenian_ci in it, why is that? Is it because Slovenia needs this encoding to assimilate certain letters in their alphabet?

Some of mysql code I have been looking using utf8_slovenian_ci in it, why is that?

Is it because Slovenia needs this encoding to assimilate certain letters in their alphabet?

If I"m using english I can omit this can't I?

Or can I use utf8 or does it do it automatically?

CREATE TABLE `users` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `FirstName` varchar(255) COLLATE utf8_slovenian_ci DEFAULT NULL,
  `LastName` varchar(255) COLLATE utf8_slovenian_ci DEFAULT NULL,
  `Address` varchar(255) COLLATE utf8_slovenian_ci DEFAULT NULL,
  `PostCode` int(8) DEFAULT NULL,
  `PostName` varchar(255) COLLATE utf8_slovenian_ci DEFAULT NULL,
  `UserName` varchar(40) COLLATE utf8_slovenian_ci DEFAULT NULL,
  `PassWord` varchar(255) COLLATE utf8_slovenian_ci DEFAULT NULL,
  `EMail` varchar(255) COLLATE utf8_slovenian_ci DEFAULT NULL,
  `Phone1` varchar(255) COLLATE utf8_slovenian_ci DEFAULT NULL,
  `Phone2` varchar(255) COLLATE utf8_slovenian_ci DEFAULT NULL,
  `Ticket` varchar(255) COLLATE utf8_slovenian_ci DEFAULT NULL,
  `Verification` int(11) DEFAULT '1',
  `RecordStatus` tiny开发者_运维问答int(1) DEFAULT '1',
  PRIMARY KEY (`Id`)
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COLLATE=utf8_slovenian_ci;


Is it because Slovenia needs this encoding to assimilate certain letters in their alphabet?

Probably not because UTF-8 already covers all imaginable characters. The collation probably contains sorting and comparison rules specific to Slovenia. (See here for an overview what a collation does and how sorting rules can vary.)

If I"m using english I can omit this can't I?

you should be able to use one of the _general collations if you don't need any country specific rules.


Yes, you can omit this, although would to use utf8, because it can store any type of character and not just english. The specific language collations are used for sorting. I wouldn't recommend using slovenian (or any other language version), unless you have a very specific reason to do so. I think it's best to use utf_unicode_ci.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号