Bug 15794 - Allow the use of emojis as tags on records
Summary: Allow the use of emojis as tags on records
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL: http://devs.bywatersolutions.com/proj...
Whiteboard:
Keywords:
: 15885 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-02-10 22:05 UTC by Nick Clemens
Modified: 2017-03-31 10:42 UTC (History)
6 users (show)

See Also:
Change sponsored?: Seeking cosponsors
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2016-02-10 22:05:18 UTC
A library requested the ability to add emojis in the tag field on the opac.

Entering an emoji now seems to scrub it clear and leave no value in the db but still enter a new tag.  Subsequent attempts warn of repeated tags.
Comment 1 M. Tompsett 2016-02-18 02:27:01 UTC
mysql> show variables like '%char%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | latin1                     |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | latin1                     |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)

mysql> set character_set_database=utf8mb4;
Query OK, 0 rows affected (0.00 sec)

mysql> set character_set_connection=utf8mb4;
Query OK, 0 rows affected (0.00 sec)

mysql> set character_set_client=utf8mb4;
Query OK, 0 rows affected (0.00 sec)

mysql> set character_set_results=utf8mb4;
Query OK, 0 rows affected (0.00 sec)

mysql> show variables like '%char%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8mb4                    |
| character_set_connection | utf8mb4                    |
| character_set_database   | utf8mb4                    |
| character_set_filesystem | binary                     |
| character_set_results    | utf8mb4                    |
| character_set_server     | latin1                     |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)

mysql> drop database test_unicode;
Query OK, 1 row affected (0.01 sec)

mysql> CREATE DATABASE test_unicode DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
Query OK, 1 row affected (0.00 sec)

mysql> use test_unicode;
Database changed
mysql> create table simple_table (text varchar(100)) collate utf8_unicode_ci;
Query OK, 0 rows affected (0.01 sec)

mysql> INSERT INTO simple_table VALUES ('💩');
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+-----------------------------------------------------------------------+
| Level   | Code | Message                                                               |
+---------+------+-----------------------------------------------------------------------+
| Warning | 1366 | Incorrect string value: '\xF0\x9F\x92\xA9' for column 'text' at row 1 |
+---------+------+-----------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> delete from simple_table;
Query OK, 1 row affected (0.00 sec)

mysql> drop table simple_table;
Query OK, 0 rows affected (0.00 sec)

mysql> create table simple_table (text varchar(100)) collate utf8mb4_unicode_ci;
Query OK, 0 rows affected (0.02 sec)

mysql> INSERT INTO simple_table VALUES ('💩');
Query OK, 1 row affected (0.01 sec)

mysql> select * from simple_table;
+------+
| text |
+------+
| 💩     |
+------+
1 row in set (0.00 sec)

mysql>
Comment 2 M. Tompsett 2016-02-18 02:29:23 UTC
https://dev.mysql.com/doc/refman/5.7/en/charset-unicode-utf8mb4.html

Hope these point in a useful direction.
Comment 3 M. Tompsett 2016-02-18 06:32:56 UTC
P.S. DataTables may not be as unicode friend as we would like for this.
Comment 4 Jonathan Druart 2016-02-18 11:57:44 UTC
See bug 11944 comment 247
Comment 5 Nicole C. Engard 2016-02-23 16:57:55 UTC

*** This bug has been marked as a duplicate of bug 15885 ***
Comment 6 Katrin Fischer 2016-02-29 21:30:06 UTC
*** Bug 15885 has been marked as a duplicate of this bug. ***
Comment 7 Nicole C. Engard 2016-03-02 16:15:46 UTC
Work to be done:

* Fix storage of Emoji characters in the database

 ** Emoji characters are supported in Unicode: http://www.unicode.org/emoji/charts/full-emoji-list.html

* Research and implement tools to display Emojis properly in the Staff and OPAC

Seeking co-sponsors: http://devs.bywatersolutions.com/projects/enable-emoji-support-tags/