3

I have already converted my mysql database/table/columns to utf8mb4 using Mathia's guide: https://mathiasbynens.be/notes/mysql-utf8mb4

I'm scraping instagram results specifically, and using utf8_concode() before persisting.

Does this PHP method support 4 byte emojis? I'm still having trouble rendering the emojis after persistance.

Dylan Pierce
  • 4,313
  • 3
  • 35
  • 45
  • Did you just try passing the emoji directly into the SQL statement? It should encode into the extended UTF format for you. – sjagr Sep 22 '15 at 15:03
  • 3
    `utf8_encode()` transcodes ISO-8859-1 to UTF-8. instagram.com is served (to me, at least) in UTF-8 already, so there's no need to transcode. – eggyal Sep 22 '15 at 15:09

1 Answers1

0

@eggyal is correct. Instagram and other social media outlets already encode the content, there is no reason to double encoded.

Am able to display emojis on my site by:

1) Switching database/table and relevant columns to utf8mb4

2) Not encoding content from instagram

3) Using the https://github.com/twitter/twemoji to display emojis on the page

Oh happy day!

Dylan Pierce
  • 4,313
  • 3
  • 35
  • 45