mysql special characters. utf8mb4 collation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Wishlist
|
Unassigned |
Bug Description
Bug reported in forum post
https:/
MySQL database as we have in Mahara does not support special characters.
In master branch and mysql DB, I added a text block to a page with text
"Some characters, like '𝑅' or emoticons '😊', produce the error."
when displaying the page I had this error:
[WAR] 72 (blocktype/
(complete error log in http://
in the DB block_instance table, the data it is trying to unserialize
"a:5:{s:
looks like the it ets cut off on the special character position when is saved in the DB
Moodle has a fix for same problem:
"UTF-8 is a character encoding that most websites use. It encodes each of the 1,112,064 valid code points. To store all of this information, four bytes is required. The most popular values are in the three byte region. MySQL by default only uses a three byte encoding and so values in the four byte range (eg. Asian characters and Emojis) can not be stored.
MySQL does provide full four byte UTF-8 support, but it requires certain database settings to be configured."
https:/
https:/
I tried using this approach by installing Mahara with utf8mb4
create database `mahara-master` character set utf8mb4 collate utf8mb4_unicode_ci
If we create the database with this char set, we wont be able to install Mahara, as it only supports utf8. Even if we remove this restriction, we will have this error:
mysqli error: [1071: Specified key was too long; max key length is 3072 bytes]
could be similar to this bug: https:/
Changed in mahara: | |
milestone: | none → 18.04.0 |
Changed in mahara: | |
status: | New → In Progress |
importance: | Undecided → Medium |
Changed in mahara: | |
status: | In Progress → Fix Committed |
tags: | added: nominatedfeature |
Changed in mahara: | |
importance: | Medium → Wishlist |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
Patch for "master" branch: https:/ /reviews. mahara. org/8160