在做微信相关开发时遇到:QQ表情转换成相应的文字显示
那...我TM哪儿去找表情转换成文字的方法啊。。。网上找了下,好多的图,你们就不能放个json然后我读json文件?
于是有下面的这个东西。请笑纳!共105个表情...
[
{
"code":"/::)",
"text":"[微笑]"
},
{
"code":"/::~",
"text":"[伤心]"
},
{
"code":"/::B",
"text":"[美女]"
},
{
"code":"/::|",
"text":"[发呆]"
},
{
"code":"/:8-)",
"text":"[墨镜]"
},
{
"code":"/::<",
"text":"[哭]"
},
{
"code":"/::$",
"text":"[羞]"
},
{
"code":"/::X",
"text":"[哑]"
},
{
"code":"/::Z",
"text":"[睡]"
},
{
"code":"/::’(",
"text":"[哭]"
},
{
"code":"/::-|",
"text":"[囧]"
},
{
"code":"/::@",
"text":"[怒]"
},
{
"code":"/::P",
"text":"[调皮]"
},
{
"code":"/::D",
"text":"[笑]"
},
{
"code":"/::O",
"text":"[惊讶]"
},
{
"code":"/::(",
"text":"[难过]"
},
{
"code":"/::+",
"text":"[酷]"
},
{
"code":"/:–b",
"text":"[汗]"
},
{
"code":"/::Q",
"text":"[抓狂]"
},
{
"code":"/::T",
"text":"[吐]"
},
{
"code":"/:,@P",
"text":"[笑]"
},
{
"code":"/:,@-D",
"text":"[快乐]"
},
{
"code":"/::d",
"text":"[奇]"
},
{
"code":"/:,@o",
"text":"[傲]"
},
{
"code":"/::g",
"text":"[饿]"
},
{
"code":"/:|-)",
"text":"[累]"
},
{
"code":"/::!",
"text":"[吓]"
},
{
"code":"/::L",
"text":"[汗]"
},
{
"code":"/::>",
"text":"[高兴]"
},
{
"code":"/::,@",
"text":"[闲]"
},
{
"code":"/:,@f",
"text":"[努力]"
},
{
"code":"/::-S",
"text":"[骂]"
},
{
"code":"/:?",
"text":"[疑问]"
},
{
"code":"/:,@x",
"text":"[秘密]"
},
{
"code":"/:,@@",
"text":"[乱]"
},
{
"code":"/::8",
"text":"[疯]"
},
{
"code":"/:,@!",
"text":"[哀]"
},
{
"code":"/:!!!",
"text":"[鬼]"
},
{
"code":"/:xx",
"text":"[打击]"
},
{
"code":"/:bye",
"text":"[bye]"
},
{
"code":"/:wipe",
"text":"[汗]"
},
{
"code":"/:dig",
"text":"[抠]"
},
{
"code":"/:handclap",
"text":"[鼓掌]"
},
{
"code":"/:&-(",
"text":"[糟糕]"
},
{
"code":"/:B-)",
"text":"[恶搞]"
},
{
"code":"/:<@",
"text":"[什么]"
},
{
"code":"/:@>",
"text":"[什么]"
},
{
"code":"/::-O",
"text":"[累]"
},
{
"code":"/:>-|",
"text":"[看]"
},
{
"code":"/:P-(",
"text":"[难过]"
},
{
"code":"/::’|",
"text":"[难过]"
},
{
"code":"/:X-)",
"text":"[坏]"
},
{
"code":"/::*",
"text":"[亲]"
},
{
"code":"/:@x",
"text":"[吓]"
},
{
"code":"/:8*",
"text":"[可怜]"
},
{
"code":"/:pd",
"text":"[刀]"
},
{
"code":"/:
"text":"[西瓜]"
},
{
"code":"/:beer",
"text":"[酒]"
},
{
"code":"/:basketb",
"text":"[篮球]"
},
{
"code":"/:oo",
"text":"[乒乓]"
},
{
"code":"/:coffee",
"text":"[咖啡]"
},
{
"code":"/:eat",
"text":"[美食]"
},
{
"code":"/:pig",
"text":"[动物]"
},
{
"code":"/:rose",
"text":"[鲜花]"
},
{
"code":"/:fade",
"text":"[枯]"
},
{
"code":"/:showlove",
"text":"[唇]"
},
{
"code":"/:heart",
"text":"[爱]"
},
{
"code":"/:break",
"text":"[分手]"
},
{
"code":"/:cake",
"text":"[生日]"
},
{
"code":"/:li",
"text":"[电]"
},
{
"code":"/:bome",
"text":"[炸弹]"
},
{
"code":"/:kn",
"text":"[刀]"
},
{
"code":"/:footb",
"text":"[足球]"
},
{
"code":"/:ladybug",
"text":"[虫]"
},
{
"code":"/:shit",
"text":"[臭]"
},
{
"code":"/:moon",
"text":"[月亮]"
},
{
"code":"/:sun",
"text":"[太阳]"
},
{
"code":"/:gift",
"text":"[礼物]"
},
{
"code":"/:hug",
"text":"[伙伴]"
},
{
"code":"/:strong",
"text":"[赞]"
},
{
"code":"/:weak",
"text":"[差]"
},
{
"code":"/:share",
"text":"[握手]"
},
{
"code":"/:v",
"text":"[优]"
},
{
"code":"/:@)",
"text":"[恭]"
},
{
"code":"/:jj",
"text":"[勾]"
},
{
"code":"/:@@",
"text":"[顶]"
},
{
"code":"/:bad",
"text":"[坏]"
},
{
"code":"/:lvu",
"text":"[爱]"
},
{
"code":"/:no",
"text":"[不]"
},
{
"code":"/:ok",
"text":"[好的]"
},
{
"code":"/:love",
"text":"[爱]"
},
{
"code":"/:
"text":"[吻]"
},
{
"code":"/:jump",
"text":"[跳]"
},
{
"code":"/:shake",
"text":"[怕]"
},
{
"code":"/:
"text":"[怄火]"
},
{
"code":"/:circle",
"text":"[圈]"
},
{
"code":"/:kotow",
"text":"[拜]"
},
{
"code":"/:turn",
"text":"[回头]"
},
{
"code":"/:skip",
"text":"[跳]"
},
{
"code":"/:oY",
"text":"[挥手]"
},
{
"code":"/:#-0",
"text":"[激动]"
},
{
"code":"/:hiphot",
"text":"[街舞]"
},
{
"code":"/:kiss",
"text":"[吻]"
},
{
"code":"/:<&",
"text":"[瑜伽]"
},
{
"code":"/:&>",
"text":"[太极]"
}
]
问题二:emoji表情实质上是unicode码中的一个,开发时,我们需要将一个unicode码对应去找一个表情,
如:'\u2600'对应'☀',在一句聊天中,用正则找出表情码,转换成相应emoji图片
那么如何将表情unicode码转换成unicode字符串?
/**
* 将unicode码转为unicode字符串
* @param string
* @return
*/
public static String unicode2unicodeString(String string) {
StringBuffer unicode = new StringBuffer();
for (int i = 0; i < string.length(); i++) {
// 取出每一个字符
char c = string.charAt(i);
// 转换为unicode
unicode.append("\\u" + Integer.toHexString(c));
}
return unicode.toString();
}
主要是这个方法:很实用啊
Integer.toHexString(c)