search

Home  >  Q&A  >  body text

ios客户端 和 php服务端 如何处理 emoji表情?

网上搜索了大堆资料,百度搜索出来都是重复的文章。这时候有点想念谷歌了。

网上的方案有什么开源的 emoji for php、或者修改数据表字段等等等,全都不管用,或者不符合我的需求

1、ios发送带emoji表情的字符串,php接收,怎样处理?以怎样的格式保存进数据库里面?
2、php查询出来,以怎样的格式返回给ios客户端?

我想知道做类似项目的同志们,你们是如何解决这个问题的?

阿神阿神2816 days ago728

reply all(6)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-17 13:28:25

    The so-called Emoji expressions are UTF-8 encoded strings. Just transfer them as usual. Just choose UTF-8 encoding when storing in the database. Let’s see how Baidu transfers the URL:
    http://www.baidu. com/s?wd=%F0%9F%98%8A&tn=84053098_dg&ie=utf-8

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 13:28:25

    Look at this
    https://github.com/diy/NSStringEmojize

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 13:28:25

    The client can directly transmit it to the server without processing. The storage method of the server must correspond. It can also be converted into your own corresponding characters like the one above and passed to the server, and then parsed locally

    reply
    0
  • 阿神

    阿神2017-04-17 13:28:25

    It is related to the character set. Your character set can support storing varchar

    reply
    0
  • PHPz

    PHPz2017-04-17 13:28:25

    mysql is stored in it or ????

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 13:28:25

    Just change the field type stored in the database, varchar should be fine

    reply
    0
  • Cancelreply