Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

UTF8MB4 support #7140

Closed
taca opened this issue Jul 1, 2014 · 3 comments
Closed

UTF8MB4 support #7140

taca opened this issue Jul 1, 2014 · 3 comments
Labels
Milestone

Comments

@taca
Copy link
Contributor

taca commented Jul 1, 2014

Dose Contao Open Source CMS support UTF8MB4 (of MySQL)?
Some characters (of Kanji) might be out side of BMP and need to use of UTF8MB4.

I created empty database created by

create database contao  default character set utf8mb4;

Then collation is defaulted to utf8mb4_generic_cl.

Next with Contao install tool,

  • set "UTF8MB4" to character set in database connection.
  • set "utf8mb4_generic_cl".

Database connection is OK, but when I update table strucure error occured.

Fatal error: Uncaught exception Exception with message Query error: COLLATION 'utf8mb4_general_ci' is not valid for CHARACTER SET 'utf8' (CREATE TABLE `tl_article` ( `id` int(10) unsigned NOT NULL auto_increment, `pid` int(10) unsigned NOT NULL default '0', `sorting` int(10) unsigned NOT NULL default '0', `tstamp` int(10) unsigned NOT NULL default '0', `title` varchar(255) NOT NULL default '', `alias` varchar(128) COLLATE utf8_bin NOT NULL default '', `author` int(10) unsigned NOT NULL default '0', `inColumn` varchar(32) NOT NULL default '', `keywords` text NULL, `showTeaser` char(1) NOT NULL default '', `teaserCssID` varchar(255) NOT NULL default '', `teaser` text NULL, `printable` varchar(255) NOT NULL default '', `customTpl` varchar(64) NOT NULL default '', `protected` char(1) NOT NULL default '', `groups` blob NULL, `guests` char(1) NOT NULL default '', `cssID` varchar(255) NOT NULL default '', `space` varchar(64) NOT NULL default '', `published` char(1) NOT NULL default '', `start` varchar(10) NOT NULL default '', `stop` varchar(10) NOT NULL default '', PRIMARY KEY (`id`), KEY `pid` (`pid`), KEY `alias` (`alias`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8mb4_general_ci;) thrown in system/modules/core/library/Contao/Database/Statement.php on line 283

I also noticed that creating table statements had different collation?

`alias` varchar(128) COLLATE utf8_bin NOT NULL default '',

Any idea?

@leofeyer leofeyer added this to the 4.0.0 milestone Jul 3, 2014
@leofeyer
Copy link
Member

leofeyer commented Jul 3, 2014

Contao does not yet support UTF8MB4, because we still support MySQL 5.0.3. I don't know if we can make MySQL 5.5.3+ the new system requirement yet. @contao/developers

@taca
Copy link
Contributor Author

taca commented Jul 4, 2014

Yes, UTF8MB4 requires newer versions of MySQL. But I do not think Contao mandatory require newer MySQL.
Is it difficult to implement support of UTF8MB4 when MySQL fulfills the encoding or required version?

Although I might open another Issue, the real problem is:

  1. User contains a character out of BMP in title or text content.
  2. When save the content, there is no error nor warning.
  3. After save, the character and text after it would be silently lost.

There should be some warning.

@leofeyer
Copy link
Member

Fixed in 37c23ff.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants