将emojis从php web app传递到Oracle db和mysql

将emojis从php web app传递到Oracle db和mysql

问题描述:

We have an php (codeigniter) web app that sending sms's. the db we connected to is oracle. when some customer trying to send emoji throgh our webapp the emoji is not displayed well on the message in the mobile phone. we can see the emoji in sql plus but it not displeyed well on pl sql. we assuming it related to some encoding issue but can't point to the exact problem.

the flow is like that

  1. PHPinsert into oracle.
  2. Java that take lines from oracle to mysql.
  3. Insert into mysql.
  4. Send as message to mobile phone.

for example :

This is how it looks in php text area :

img1

this is how it looks with PL/SQL after insert to oracle:

img1

this is how it looks with SQL PLUS after insert to oracle :

img1

and this is how it looks in mysql:

img1

and also in the mobile phone message:

img1

The charset in mysql and oracle is utf8mb4

we tryed to change the query in php to be like insert into sms(messaage) values(?) we tried to change the type of the column from varchar2 to clob

edit

the connection from the PHP to oracle is set well i think ,as you can see here:

img1

我们有一个发送短信的php(codeigniter)网络应用程序。 我们连接的数据库是oracle。 当一些客户试图通过我们的webapp发送表情符号时,表情符号在手机中的消息上显示不好。 我们可以在sql plus中看到表情符号,但它并没有在pl sql上很好地消失。 我们假设它与某些编码问题有关,但不能指出确切的问题。 p>

流程就像那样 p>

  1. PHP插入oracle。 li>
  2. 从oracle到mysql的Java。 li>
  3. 插入mysql。 li>
  4. 作为消息发送到手机 。 li> ol>

    例如: p>

    这是它在php文本区域中的样子: p>

    p>

    这是插入后PL / SQL的外观 到oracle: p>

    p>

    这是插入到oracle后SQL PLUS的外观: p>

    这就是它在mysql中的样子: p>

    p>

    以及手机短信: p>

    p>

    mysql和oracle中的字符集是utf8mb4 h1>

    我们尝试了cha nge php中的查询就像插入sms(messaage)值(?)我们试图将列的类型从varchar2更改为clob p>

    编辑 h1> \ n

    我认为从PHP到oracle的连接设置得很好,你可以在这里看到: p>

    p> div>

i have found the solution . needed to change the connection charset from php to oracle to be 'AL32UTF8' insted of 'utf8'. now it works great. thank you