Updating fields with emojies/unicode icons?

(2 posts) (2 voices)
  1. duane, Member

    Hi. I have editable fields which are text. Sometimes an emoji/unicode icon is included in the text. When this happens the update failes.

    The database is mariadb with utf8mb4 set - so it should work in theory. Any suggestions for getting it to accept unicode characters from a text field update?

    (it doesn't work in the demo reports either - see https://mydbr.com/demo/mydbr/report.php?r=77&m=1&h=25541008f09ce098a477425247b8c6ef47ff7377&i=1 where I tried to add: 💔)

  2. myDBR Team, Key Master

    Most likely your connection is using utf8 or your database character set is utf8 (i.e. it can store 3-byte characters) or your default character set for the database is utf8 (procedures use the db character set for string/text parameters if not specifically set).

    First, check the connection myDBR uses. See if the mydbr_config.php has a row:

    define( "DB_CHARSET", 'utf8mb4' );

    Then check the default database for the database:

    show variables like "character_set_database";

    You can change the character set via ALTER DATABASE-command.

    Finally, if your setup uses uf8, you can specify the character set for the parameter via the 'character set' definition. Sample procedure parameter would be:

    inParameter varchar(100) character set utf8mb4

    And for the demo, myDBR demo database is old enough that it was created before MySQL 5.5.3 which introduced the utf8mb4. The demo db uses still utf8. We'll update the character set for the demo (we've updated the report in question)

    myDBR Team


You must log in to post.