WeChat public account development tutorial 12th-sending of symbolic expressions (Part 2)

Source: Internet
Author: User
Tags comparison table

Overview

The first article provides the uniied version of the emoji code table, and introduces how to send emoji in the public account development mode. At the end of the article, I sold a token: "Some symbolic expressions used in the Q robot cannot be found in the selection column of the symbolic emoticons, and the symbolic emoticons code table provided in the previous article (for the uniied Version) no. How are these expressions sent?" As shown in the following two figures, the symbolic expressions are "couple" and "bus ".

This article mainly introduces the following content: 1) how to use more symbolic expressions (that is, how to send emoji expressions that do not exist in the selection bar of symbolic expressions); 2) the Code comparison table of the symbol expressions of SoftBank edition is provided. 3) This table introduces and demonstrates how to send the symbol expressions of SoftBank edition. Let everyone play with the emoji expression of the public account!

 

How to use more symbolic expressions on

First, let's take a look at how a user can send signed emojis that are not listed in the selection bar to friends or public accounts. For example, Q robot uses two symbolic expressions: "couple" and "bus". What should I do if I want to use them when chatting with my friends? Take a look at the following two:

As you can see, when we enter "couples" in the input box, "qinglv", "bus", and "gonggongqiche, the text prompt list of the Input Method automatically displays the corresponding symbolic expression. How is it easy? There are many such expressions, such as toilets, toilets, and cash machines.

Note: The author uses the input method of the iPhone 4S mobile phone system for testing. If you are using Android, or a third-party input method, it is another matter.

 

SoftBank version of Emoji code table

As mentioned in the previous article, there are many versions of emoji, including uniied, DoCoMo, KDDI, Softbank, and Google. Different Versions of Unicode code used to express the same symbolic expression are also different. This article provides the emoji code table of the SoftBank (Japanese SoftBank group) version, as shown in:

 

How can a public account send a signed expression of the SoftBank version to a user?

In the public account development mode, sending a SoftBank version of the symbolic expression is much easier than sending a uniied version of the symbolic expression, directly write the SoftBank Unicode value corresponding to the symbol expression in the program code and return it to the user without any processing.

Below, I will give an example of sending a SoftBank expression. The Code is as follows:

Package org. liufeng. course. service; import java. util. date; import java. util. map; import javax. servlet. http. httpServletRequest; import org. liufeng. course. message. resp. textMessage; import org. liufeng. course. util. messageUtil; /*** core service class ** @ author liufeng * @ date 2013-07-21 */public class CoreService {/*** Process sent requests ** @ param request * @ return */public static String processRequest (HttpServletRequest request) {String respMessage = null; try {// xml Request Parsing Map <String, String> requestMap = MessageUtil. parseXml (request); // sender account (open_id) String fromUserName = requestMap. get ("FromUserName"); // public account String toUserName = requestMap. get ("ToUserName"); // reply to the text message TextMessage textMessage = new TextMessage (); textMessage. setToUserName (fromUserName); textMessage. setFromUserName (toUserName); textMessage. setCreateTime (new Date (). getTime (); textMessage. setMsgType (MessageUtil. RESP_MESSAGE_TYPE_TEXT); textMessage. setFuncFlag (0); textMessage. setContent ("Bicycle \ ue136 men \ ue138 wallet \ ue12f couples \ ue428 bus \ ue159"); respMessage = MessageUtil. textMessageToXml (textMessage);} catch (Exception e) {e. printStackTrace ();} return respMessage ;}}

The purpose of the above Code is to return text messages containing five emoji no matter what type of messages the user sends. If you do not understand what is going on with the CoreService class, check the 5th articles in this series of tutorials, Or you only need to carefully read the 42nd lines of code, I know how to put the emoji code of SoftBank in the Content of a text message. Finally, let's take a look at the running effect:

Note: Each symbolic expression has the corresponding uniied unicode and Softbank unicode code, it doesn't mean that emoji expressions that cannot be found in the symbol emoticons such as "couple" and "bus" can only be sent in the way described in this article, as long as you get the corresponding uniied unicode code, you can also use the method described in the previous article to send such symbolic expressions.

 

Now, the explanation of sending a symbolic expression to a user in a public account is over. I believe some of you have started to use it in your account after reading the tutorial. In fact, I hope that you can understand the various versions of symbolic expressions, Unicode encoding, and supplementary codes while copying the signed expressions of the Unified and SoftBank versions that I have attached, by constantly expanding your knowledge, you can truly turn the knowledge I have explained into your own.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.