Zen Cart Logo
Forums / Upgrading to 1.5.x / utf8_general_ci or utf8_unicode_ci collation?

utf8_general_ci or utf8_unicode_ci collation?

Views: 2,139

Results 1 to 4 of 4
21 Nov 2013, 10:11 AM
#1
cphilips avatar

cphilips

New Zenner

Join Date:
Jun 2005
Posts:
18
Plugin Contributions:
0

utf8_general_ci or utf8_unicode_ci collation?

I see that Dr.Byte's MYSQL script (and other Zen Cart messages) say to change MYSQL collation to utf8_general_ci, but a Numinix message on updating ZenCart to utf8 suggests utf8_unicode_ci is best.

Which is best to use when upgrading from Latin collation?

I found the following statement at http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci:

"There is almost never any reason to use utf_general_ci anymore, as we have left behind the point where CPU speed is low enough that the performance difference would be important. Your database will almost certainly be limited by quite other bottlenecks than this nowadays. The difference in performance is only going to be measurable in extremely specialised situations, and if that's you, you'd already know about it. If you're experiencing slow sorting, in almost all cases it'll be an issue with your indexes/query plan.

When I originally wrote this answer (over 3 years ago) I said that if you wanted, you could use utf8_general_ci most of the time, and only use utf8_unicode_ci when sorting was going to be important enough to justify the performance cost. However, the performance cost is no longer really relevant (and it may not have been back then, either). It's more important to sort properly in whichever language your users are using."

On the one hand, why not upgrade to the most accurate (utf8_unicode), but are there other "Zen Cart" reasons not to?

21 Nov 2013, 11:06 AM
#2
cvhainb avatar

cvhainb

Zen Follower

Join Date:
Sep 2008
Posts:
212
Plugin Contributions:
19

Re: utf8_general_ci or utf8_unicode_ci collation?

I think the same.

21 Nov 2013, 6:13 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: utf8_general_ci or utf8_unicode_ci collation?

cphilips:

I see that Dr.Byte's MYSQL script (and other Zen Cart messages) say to change MYSQL collation to utf8_general_ci, but a Numinix message on updating ZenCart to utf8 suggests utf8_unicode_ci is best.
My point was to use general instead of "bin" which was typically proffered as the default. Use general or unicode, based on your site's needs. I see no problem using utf8_unicode_ci.

22 Nov 2013, 5:44 AM
#4
cphilips avatar

cphilips

New Zenner

Join Date:
Jun 2005
Posts:
18
Plugin Contributions:
0

Re: utf8_general_ci or utf8_unicode_ci collation?

Thanks for the reply; I don't have an immediate need, but in time I might make the small modification to your script (which works great, thanks!), and switch over from utf8_general to utf8_unicode.