从android发送文本和表情符号到PHP?

我试图将android的文本+表情符号发送到另一个android通过php,在php中我写了代码插入到 mysql,一切都运行良好,但当它进入表格时,结果改为问号“??”
我试图找到关于这个的教程但我不能在我的应用程序中尝试它</ p>

我尝试使用json数组发送文本+表情符号。</ p>

我在java中使用此代码发送到php </ p>

  HttpClient客户端 = new DefaultHttpClient(); 
HttpResponse response;
try {
HttpPost post = new HttpPost(url);
List&lt; NameValuePair&gt; nVP = new ArrayList&lt; NameValuePair&gt;(2);

nVP.add(new BasicNameValuePair(“mydata”,paketan.toString())); // studentJson是JSON输入
post.setEntity(new UrlEncodedFormEntity(nVP,“UTF-8”));
response = client.execute(post);
response.setHeader(“Content-Type”,“ application / json; charset = utf-8“);
hsl = org.apache.http.util.EntityUtils.toString(response.getEntity());
</ code> </ pre>

< 这个登录日食。</ p>

  [{“Time”:“2015-07-09 14:21:17”,“msg”:“测试表情符号

展开原文

原文

I tried to send text + emoji of android to another android throught php, in php I wrote the code to insert into mysql, everything work well but when it entered into table, the result change tobe question mark "??" I've tried to find tutorials about this but I cant try it in my application

I tried to send a text + emoji using json array.

I use this code in java to send to php

HttpClient client = new DefaultHttpClient();
HttpResponse response;
try{
    HttpPost post = new HttpPost(url);
    List<NameValuePair> nVP = new ArrayList<NameValuePair>(2);  
    nVP.add(new BasicNameValuePair("mydata", paketan.toString()));  //studentJson is the JSON input
    post.setEntity(new UrlEncodedFormEntity(nVP,"UTF-8"));
    response = client.execute(post);
    response.setHeader("Content-Type", "application/json; charset=utf-8");
    hsl = org.apache.http.util.EntityUtils.toString(response.getEntity());

this log in eclipse.

[{"Time": "2015-07-09 14:21:17", "msg": "test emoji 

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐