使用表情符号unicode标志国家创建字符串 [英] Create string with emoji unicode flag countries

查看:122
本文介绍了使用表情符号unicode标志国家创建字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建一个带有国家标志unicode表情符号的字符串..我这样做了:

i need to create a String with a country flag unicode emoji..I did this:

StringBuffer sb = new StringBuffer();
sb.append(StringEscapeUtils.unescapeJava("\\u1F1EB"));    
sb.append(StringEscapeUtils.unescapeJava("\\u1F1F7"));

期待一个国家的国旗,但我没有..我怎样才能在String中获得一个unicode国家国旗表情符号unicodes字符?

Expecting one country flag but i havent..How can i get a unicode country flag emoji in String with the unicodes characters?

推荐答案

你应该能够只使用 toChars 来自 java.lang.Character

You should be able to do that simply using toChars from java.lang.Character.

这对我有用:

    StringBuffer sb = new StringBuffer();
    sb.append(Character.toChars(127467));
    sb.append(Character.toChars(127479));
    System.out.println(sb);

这篇关于使用表情符号unicode标志国家创建字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆