Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎么把输出来的表情转换成类似这样的字符串\ue32d #161

Open
nicech6 opened this issue May 3, 2017 · 2 comments
Open

怎么把输出来的表情转换成类似这样的字符串\ue32d #161

nicech6 opened this issue May 3, 2017 · 2 comments

Comments

@nicech6
Copy link

nicech6 commented May 3, 2017

怎么把输出来的表情转换成类似这样的字符串\ue32d

@TakWolf
Copy link

TakWolf commented May 3, 2017

public class Main {

    public static void main(String[] args) {
        String a = "你好,世界!";
        for (int i = 0; i < a.codePointCount(0, a.length()); i++) {
            int codePoint = a.codePointAt(i);
            System.out.println(Integer.toHexString(codePoint));
        }
        // 输出:4f60 597d ff0c 4e16 754c ff01
        System.out.println("\u4f60\u597d\uff0c\u4e16\u754c\uff01");
        // 输出:你好,世界!
    }

}

@ghost
Copy link

ghost commented May 3, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants