Emojicons Send face icons not work, send number icons work [closed]

拜拜、爱过 提交于 2019-12-12 01:06:18

问题


When I send emojis nums icons, 1,2,3,4,5.... send correctly, But when I try send emojis icons how smile or others ... not send nothing ...

My debug show a face smile, but not send. why ? then seems to not clean the buffer, and when you rewrite, the activity is closed, but not when using numbers icons emojis.

The listener not called, when I use icons fases, but yes when I use icons numbers.

public void sendMessageServer()throws XMPPException{
        Message msg= new Message();
        String tim =  "            "+time;
        Chat chat = chatManager.createChat(CurrentUsernameClick+"@delive", messageListener);
        if(message_list.getText().toString()!=null && message_list.length()>0){
            String text = message_list.getText().toString();
            msg.setBody(message_list.getText().toString() +tim);
            chat.sendMessage(message_list.getText().toString() + tim);
            addNewMessage(new Messages(msg.getBody(), true));
            UserDataAccesObject.createMessage(id, id, msg.getBody(), usernameSession, CurrentUsernameClick, time);
            message_list.setText("");
        }
    }

DEBUG SHOW :

I send correctly numbers, but smiles face not.

http://apps.timwhitlock.info/emoji/tables/unicode

I have 2 ideas : 1 (orc) 2 (ASCII)

1 -

I think that I need recognize characters not? with library OCR not ?

in my debugger, show [?] with icons, I think that is because not recognize character correctly, or am I wrong?

2 -

Or can be ASCII ?


回答1:


Try showing the hex values of the characters in your strings. You may find that the first one shows 0x0031 (DIGIT ONE) and 0x20DE (COMBINING ENCLOSING SQUARE), which are two Unicode code points that combine together to make "1⃞". The second one may show 0xD83D 0xDE03, which is UTF-16 for a single Unicode character "😃" (U+1F603 SMILING FACE WITH OPEN MOUTH). Next look at what actually gets written on the wire. In hex, the first one should be: 31E2839E and the second should be F09F9883, both of which are the UTF-8 encodings for their respective Unicode code points.

Several libraries have bugs dealing with characters higher than U+FFFF. It may be that you have run into one of these. If that is the case, you might see something like EDA0BDEDB883 (hex) for the smilie's output. This is invalid UTF-8, and should be rejected by a server compliant with RFC 6120.




回答2:


Send smile using htmlescape using apache common util lib it works for me



来源:https://stackoverflow.com/questions/23576507/emojicons-send-face-icons-not-work-send-number-icons-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!