View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
10381Bug reportsSurvey takingpublic2016-02-17 18:10
Reporterronaldun Assigned Toc_schmitz  
PrioritynormalSeveritypartial_block 
Status closedResolutionfixed 
Product Version2.06+ 
Fixed in Version2.50.x 
Summary10381: exception when the text has emotion icons
Description

When insert emotion icon in answer text box in survey, Limesurvey will show exception.

Steps To Reproduce

insert string like "

TagsNo tags attached.
Attached Files
limesurvey db error.png (39,201 bytes)   
limesurvey db error.png (39,201 bytes)   
test string.txt (12 bytes)   
๐Ÿ˜Štest abc
test string.txt (12 bytes)   
Bug heat10
Complete LimeSurvey version number (& build)160129
I will donate to the project if issue is resolvedNo
Browser
Database type & version5.6.11
Server OS (if known)Windows server 2008
Webserver software & version (if known)IIS7
PHP Version5.4

Users monitoring this issue

There are no users monitoring this issue.

Activities

ronaldun

ronaldun

2016-02-11 05:49

reporter   ~34875

When insert emotion icon in answer text box in survey, Limesurvey will show exception.

DenisChenu

DenisChenu

2016-02-11 10:07

developer   ~34882

Hi,

When ? In admon part ? Public part ?

Can you detail the way to reproduce ?

ronaldun

ronaldun

2016-02-11 10:13

reporter   ~34886

Hi Denis,

In public part.

You can try to use the text in "test string.txt", the 1st character is a smiley face. you copy the text to the multi-line text box, submit the form and the Limesurvey should show the error.

Thanks.

LouisGac

LouisGac

2016-02-11 15:13

developer   ~34910

looks like a Yii bug :
http://www.yiiframework.com/forum/index.php/topic/57967-incorrect-string-value-saving-a-string-with-emoji-into-db/

ollehar

ollehar

2016-02-11 15:27

administrator   ~34911

Cannot reproduce on pgsql.

DenisChenu

DenisChenu

2016-02-11 15:59

developer   ~34920

Last edited: 2016-02-11 16:16

More a SQL "bug" : but unsure

Actually table is utf8 , need utf8mb4 for text question type ?

Can not reproduce with mysql too : Update is done, but emoticons is not saved.

MYSQL :http://stackoverflow.com/a/19224197/2239406
MYSQL step 2 : http://stackoverflow.com/a/9509773/2239406 utf8mb4 or utf16 with mysql 5.5 and more

LouisGac

LouisGac

2016-02-11 17:00

developer   ~34927

in fact, I think that bug is quiet important. Many phones today offer emoji by default...

ronaldun

ronaldun

2016-02-12 02:37

reporter   ~34967

After researched, it seems mysql utf8 does not fully support Unicode, need to change utf8mb4.
I tried two minor versions of mysql in mysql workbench. In newer version (5.6.2x), it just truncate the non-supported strings.The older version (5.6.1x), it will show error.

http://dba.stackexchange.com/questions/20690/how-can-i-insert-smiley-faces-into-mysql
https://mathiasbynens.be/notes/mysql-utf8mb4#character-sets

I agree with LouisGac, as I cannot control the user what to input. As utf8mb4 is supported from mysql 5.5 and above only, I suggest the emoji should be converted or filtered out in Limesurvey before saving to database to maintain mysql version compatibility.

Thanks.

DenisChenu

DenisChenu

2016-02-12 07:10

developer   ~34969

Think if we have mysql 5.5 : use utf16 not utf8mb4.
http://stackoverflow.com/a/9509773/2239406
http://dev.mysql.com/doc/refman/5.5/en/charset-unicode.html

Aternative is to use BLOB for text

ronaldun

ronaldun

2016-02-15 04:38

reporter   ~35104

As far as I know, utf8 is not compatible to utf16.
http://www.differencebetween.net/technology/difference-between-utf-8-and-utf-16/

So I think you need to change the UI and database to utf16 at the same time, that is a big project.

DenisChenu

DenisChenu

2016-02-15 08:10

developer   ~35105

You'r right, the blob or utf8mb4 :)

c_schmitz

c_schmitz

2016-02-17 10:17

administrator   ~35286

utf8mb4 it is.

c_schmitz

c_schmitz

2016-02-17 12:50

administrator   ~35302

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=17467

DenisChenu

DenisChenu

2016-02-17 17:44

developer   ~35325

Fix manual, maybe partially
https://manual.limesurvey.org/index.php?title=Installation&action=historysubmit&type=revision&diff=66393&oldid=66381

then mssql don't have issue :) great :)

c_schmitz

c_schmitz

2016-02-17 18:10

administrator   ~35329

Version 2.50+ Build 160217 released

Related Changesets

LimeSurvey: master c920562b

2016-02-17 11:03:39

c_schmitz

Details Diff
Fixed issue 10381: Problems when using emoji icons Affected Issues
10381
mod - application/commands/InstallCommand.php Diff File
mod - application/config/version.php Diff File
mod - application/controllers/InstallerController.php Diff File
mod - application/core/db/MysqlSchema.php Diff File
mod - application/helpers/update/updatedb_helper.php Diff File
mod - application/models/Token.php Diff File
mod - installer/sql/create-mssql.sql Diff File
mod - installer/sql/create-mysql.sql Diff File
mod - installer/sql/create-pgsql.sql Diff File

Issue History

Date Modified Username Field Change
2016-02-11 05:39 ronaldun New Issue
2016-02-11 05:39 ronaldun File Added: limesurvey db error.png
2016-02-11 05:49 ronaldun Note Added: 34875
2016-02-11 10:06 DenisChenu Description Updated
2016-02-11 10:06 DenisChenu Steps to Reproduce Updated
2016-02-11 10:07 DenisChenu Note Added: 34882
2016-02-11 10:13 ronaldun Note Added: 34886
2016-02-11 10:13 ronaldun File Added: test string.txt
2016-02-11 15:13 LouisGac Note Added: 34910
2016-02-11 15:27 ollehar Note Added: 34911
2016-02-11 15:59 DenisChenu Note Added: 34920
2016-02-11 16:04 DenisChenu Note Edited: 34920
2016-02-11 16:13 DenisChenu Note Edited: 34920
2016-02-11 16:16 DenisChenu Note Edited: 34920
2016-02-11 17:00 LouisGac Note Added: 34927
2016-02-12 02:37 ronaldun Note Added: 34967
2016-02-12 07:10 DenisChenu Note Added: 34969
2016-02-15 04:38 ronaldun Note Added: 35104
2016-02-15 08:10 DenisChenu Note Added: 35105
2016-02-15 10:59 c_schmitz Assigned To => c_schmitz
2016-02-15 10:59 c_schmitz Status new => assigned
2016-02-17 10:17 c_schmitz Note Added: 35286
2016-02-17 12:50 c_schmitz Changeset attached => LimeSurvey master c920562b
2016-02-17 12:50 c_schmitz Note Added: 35302
2016-02-17 12:50 c_schmitz Resolution open => fixed
2016-02-17 12:58 c_schmitz Status assigned => resolved
2016-02-17 12:58 c_schmitz Fixed in Version => 2.5
2016-02-17 17:44 DenisChenu Note Added: 35325
2016-02-17 18:10 c_schmitz Note Added: 35329
2016-02-17 18:10 c_schmitz Status resolved => closed