0

Users sometimes input some emoji in my BBS, but I am using MySQL version 5.0 which cannot store emoji code (as UTF).

I can not upgrade MySQL to 5.5 right now, so is there any safe way to filter the emoji code?

Rebecca Scott
  • 2,421
  • 2
  • 25
  • 39
Tinyfool
  • 1,460
  • 2
  • 18
  • 40
  • 2
    There's absolutely no reason why mysql can't store emoji. They're just UTF characaters. it'd be YOUR table definitions, charsets, and collations that prevent them from being stored. – Marc B Dec 30 '11 at 04:13
  • 2
    Mysql has had unicode support (utf-8 and ucs2) since 4.1. There's been specific japanese charset support since at least 3.23 as well: http://dev.mysql.com/doc/refman/4.1/en/charset-charsets.html – Marc B Dec 30 '11 at 04:20
  • 1
    The utf8mb4, utf16, and utf32 character sets were added in MySQL 5.5.3. http://dev.mysql.com/doc/refman/5.5/en/charset-charsets.html http://stackoverflow.com/questions/7814293/how-to-insert-utf-8-mb4-characteremoji-in-ios5-in-mysql – Tinyfool Dec 30 '11 at 05:49
  • Note that Emoji are (generally) represented in Unicode using characters outside the BMP, starting around U+1F300. –  Dec 30 '11 at 06:01
  • This question needs to have at least its subject rewritten, because the subject (and description) talks about removing emojis, but the accepted answer talks about a (database-specific) workaround that does NOT remove them, which is therefore not really answering the question as stated. – J-P Jun 06 '16 at 16:08

1 Answers1

1

First, I don't know how to remove emoji code.

If you can't upgrade to mysql5.5, storing your text using the blob type will resolve your problem.

Rebecca Scott
  • 2,421
  • 2
  • 25
  • 39
guoxx
  • 348
  • 1
  • 9