Zen Cart Logo
Forums / Upgrading to 2.x.x / Recommended charset for DB utf8 or utf8mb4

Recommended charset for DB utf8 or utf8mb4

Views: 686

Results 1 to 4 of 4
29 Apr 2024, 10:07
#1
gernot avatar

gernot

Zen Follower

Join Date:
Feb 2017
Location:
Tokyo, Japan
Posts:
334
Plugin Contributions:
0

Recommended charset for DB utf8 or utf8mb4

Hello all,
I am doing a clean install of v2.0.0 to test, and notice that the example includes/dist-configure.php has the DB charset set to utf8.
PHP version is 8.2 and MariaDB version is 10.3.24.

Is there any guidance on whether utf8 or utf8mb4 is most apprpriate for the DB? I thought that utf8 had certain limitations and therefore utf8mb4 was preferred to handle multibyte characters going forward, but I am not clear on this.

I'd like to convert my current production 1.5.6c database from utf8 to utf8mb4 using the recommended scripts, before upgrading the production DB to v2.0.0. I expected v2.0.0 to use utf8mb4 as a default, but if utf8 is sufficient then that is no longer necessary.

Any advice appreciated.

29 Apr 2024, 10:39
#2
g2ktcf avatar

g2ktcf

Totally Zenned

Join Date:
Feb 2011
Location:
Lumberton, TX
Posts:
636
Plugin Contributions:
0

Re: Recommended charset for DB utf8 or utf8mb4

gernot:

Hello all,
I am doing a clean install of v2.0.0 to test, and notice that the example includes/dist-configure.php has the DB charset set to utf8.
PHP version is 8.2 and MariaDB version is 10.3.24.

Is there any guidance on whether utf8 or utf8mb4 is most apprpriate for the DB? I thought that utf8 had certain limitations and therefore utf8mb4 was preferred to handle multibyte characters going forward, but I am not clear on this.

I'd like to convert my current production 1.5.6c database from utf8 to utf8mb4 using the recommended scripts, before upgrading the production DB to v2.0.0. I expected v2.0.0 to use utf8mb4 as a default, but if utf8 is sufficient then that is no longer necessary.

Any advice appreciated.

I was doing the same thing yesterday and found that utf8mb4 is the recommended in the installation documents. This allows your customers and others to use multibyte characters like emoji's and certain diacritical marks for other languages. At least that is how I understand it.

29 Apr 2024, 10:41
#3
gernot avatar

gernot

Zen Follower

Join Date:
Feb 2017
Location:
Tokyo, Japan
Posts:
334
Plugin Contributions:
0

Re: Recommended charset for DB utf8 or utf8mb4

Thank you! Much appreciated.

29 Apr 2024, 12:59
#4
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Recommended charset for DB utf8 or utf8mb4

I was doing the same thing yesterday and found that utf8mb4 is the recommended in the installation documents.

Correct.