2
我有巨大的字符串數組通過使用Textview
顯示。這個String數組包含一些匿名字符,如',',','等。但它在英語中沒有意義,請幫助我如何在實際意義上解碼這些字符。Java中的「,?,?,?」轉換如何?
我已經使用UTF-8編碼但不起作用。
private final static Charset UTF8_CHARSET = Charset.forName("UTF-8");
public static String getUTF8Encoded(String targetString) {
String resultant = "";
try {
return new String(encodeUTF8(targetString), UTF8_CHARSET);
} catch (Exception e) {
e.printStackTrace();
return resultant;
}
}
private static final byte[] encodeUTF8(String string) {
return string.getBytes(UTF8_CHARSET);
}
這些字符是否有相應的拉丁字母?例如類似西裏爾字母的東西? – ishmaelMakitla
[「‖」在頁面上顯示而不是「'」]的可能重複(http://stackoverflow.com/questions/2477452/%c3%a2%e2%82%ac-showing-on-page-instead -的) – Lori