Encounter a problem, to save iOS keyboard output emoji expression to MySQL, I know that with Blob+utf8 can be saved. But now my watch is too big to change the type. So I want to match the emoji expression, replace it, then save it.
However, iOS keyboard input emoji expression, not the standard 0xe001 - 0xe537 this, but changed.
For example: The first laugh expression, the standard emoji Unicode is 0xe415 and the iOS keyboard output is 0xd83dxde04 two bits.
I use Preg_match () to make a match
Preg_match ($matches); Var_dump ($matches);
Print out is a NULL
Ask the gods, how can you match this emoji ah ...
Add: I use Preg_match ('/[\x{0000}-\x{ffff}]/u ', $str _with_emoji_emotion, $matches); Go to match is not matched to ... I suspect it's a question of the emoji, and continue to study ... Continue solving ...
Supplement 2: Today's done, did the Bin2Hex transcoding http://jiajun.org/g/emoji_encoder.php
It's done today, Bin2Hex's transcoding http://jiajun.org/g/emoji_encoder.php.
In fact, there is an open source conversion program.
http://code.iamcal.com/php/emoji/
Https://github.com/iamcal/php-emoji
Give it a try.
Preg_match ($matches);
The problem of emoji and JSON in OBJECT-C