Emoji表情转UTF-8编解码、过滤

try {
    //编码
    String encodeStr = URLEncoder.encode(""+input.getText().toString(), "UTF-8");
    testHello.setText(encodeStr);
    //解码
    String decodeStr = URLDecoder.decode(encodeStr, "UTF-8");
    testWorld.setText(""+decodeStr);
} 
catch (UnsupportedEncodingException e) {
    e.printStackTrace();
}

你可能感兴趣的:(Emoji表情转UTF-8编解码、过滤)