On MariaDB if the database was created without specifying charset (i.e. issuing CREATE DATABASE openemr) then the DB will use utf8mb4 character set by default.
Initial install fails with the following message:
unable to execute SQL: 'CREATE TABLE drug_templates ( drug_id int(11) NOT NULL, selector varchar(255) NOT NULL default '', dosage varchar(10) default NULL, period int(11) NOT NULL default '0', quantity int(11) NOT NULL default '0', refills int(11) NOT NULL default '0', taxrates varchar(255) default NULL, PRIMARY KEY (drug_id,selector)) ENGINE=InnoDB' due to: Specified key was too long; max key length is 767 bytes
Need to use utf8 charset to create the database, as automatic install does.
Diff:
I understand utf8mb4 is desirable for supporting languages like Chinese, Japanese and Korean. Doubtless we should work towards that.
Oh and I think it would be safe to make the selector much shorter, say 128 characters.
Hi,
Agree that we should support UTF8MB4 (I am pretty sure UTF8 works for all languages including Chinese, but the extra bit in UTF8MB4 allows other characters such as emoticons etc.).
We went through a similar process when converted from latin1 to UTF8 in OpenEMR 3.1.0 with some of the phpgacl table keys.
-brady