android表情符号使用,android评论输入表情符号
将String字符串转换为UTF-8编码字符串/*** 字符串换成UTF-8**@paramstr*@return*/public static String stringToUtf8(String str) {String result = null;try {result = URLEncoder.encode(str, "UTF-8");} catch...
将String字符串转换为UTF-8编码字符串
/** * 字符串换成UTF-8 * *
@paramstr *
@return*/
public static String stringToUtf8(String str) {
String result = null;
try {
result = URLEncoder.encode(str, "UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return result;
}
将UTF-8编码字符串转换为String字符串
/** * utf-8换成字符串 * *
@paramstr *
@return*/
public static String utf8ToString(String str) {
String result = null;
try {
result = URLDecoder.decode(str, "UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block e.printStackTrace();
}
return result;
}
更多推荐
所有评论(0)