• When I do this:
    Try to post a standard post with any title (or other standard post fields) that includes a Turkey Emoji ????
    (see also: https://www.iemoji.com/view/emoji/1861/animals-nature/turkey)

    This happens:
    The post occurs as expected, but WordPress “sanitizes” the turkey emoji out of the post! I suspect that this particular emoji is either so new it’s isn’t recognized by the system like others, or its UTF-8 equivalent code may be improperly recognized as rogue code somehow when the inputs are sanitized.

    For thoroughness, I thought I’d post this issue here as well as the original in relation to the Instagram plugin and related post which caused me to recognize the problem: https://github.com/jtsternberg/DsgnWrks-Instagram-Importer/issues/27

    Has anyone else seen this with relation to the recent Thanksgiving holiday in the U.S.?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Nope, WordPress does indeed have and support the turkey emoji. Tested on trunk, latest version.

    If your browser doesn’t render the turkey, then the core code converts it to this image:
    https://s.w.org/images/core/emoji/2.2.1/svg/1f983.svg

    Or equivalent pngs and such.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Here’s what it looks like on a test site running 2016:

    Cloudup wftbclfchcv

    I can replicate this, on Godaddy Managed WordPress hosting – the emoji are stripped from the post title. Also see the same issue with the Instagram importing plugin.

    Could this be related to database collation?
    MySQL charset: UTF-8 Unicode (utf8)

    Posts table collation is utf8_unicode_ci
    Post Meta collation is utf8_unicode_ci
    Term Meta collation is utf8mb4_unicode_ci

    Other tables are utf8_general_ci or latin1_swedish_ci

    Any thoughts @otto42 – what should be collation, could it be connected?

    Thanks,

    Ian.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    If you’re using a recent installation of WordPress, and a recent version of MySQL, then the CHARSET should be “utf8mb4” and the COLLATE should be “utf8mb4_unicode_ci”.

    Older installs may have different table layouts. WordPress contains an update routine that updates the relevant tables when you move from a version prior to 4.4 to one later than 4.4.

    If your tables are not all properly converted to utf8mb4, then yeah, you probably cannot properly store emoji in them. It should work most of the time due to the compatibility layers, but perhaps not all of the time.

    You can convert your tables to utfmb4 manually if you like.

    Hi Otto,

    Thanks, I’ve now updated the collation and charset.

    Error remains.

    Post title I’m testing on ‘Today be like… ????’

    (looks like the emoji don’t show here, but it’s the caption from this Instagram Image
    https://www.instagram.com/p/BO7J6spgmsl/ )

    When editing directly via PhpMyAdmin MySQL throws the following error.

    Affected rows: 1
    Warning: #1300 Invalid utf8 character string: ‘F09F91’
    Warning: #1366 Incorrect string value: ‘\xF0\x9F\x91\x99\xF0\x9F…’ for column ‘post_title’ at row 1

    Any thoughts?

    /

    For others looking on the collation update:
    I ran this query to update the database defaults:
    ALTER DATABASE YourDatabaseName CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci

    Then this query to generate the query to update the collation on each table, credit:
    https://stackoverflow.com/questions/10859966/how-to-convert-all-tables-in-database-to-one-collation#10860122

    SELECT CONCAT(“ALTER TABLE “, TABLE_NAME,” COLLATE utf8mb4_unicode_ci”) AS ExecuteTheString
    FROM INFORMATION_SCHEMA.TABLES
    WHERE TABLE_SCHEMA=”YourDatabaseName”
    AND TABLE_TYPE=”BASE TABLE”

    • This reply was modified 8 years, 2 months ago by ianatkins.
    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    looks like the emoji don’t show here

    Umm.. I’m seeing emoji in my browser here just fine.

    Perhaps this is something in your client not displaying these?

    This is bunch of turkey emoji’s. They do indeed show up on this forum:
    ??????????????????

    See them?

    In your rather direct method of conversion, you may have some mangled characters in your database, because conversion is more than just an “alter table”. You may need to correct those characters manually.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘WordPress “chokes” on Turkey emoji for Thanksgiving’ is closed to new replies.