これは変換されませんå
String j_post = new String((byte[]) j_posts.getJSONObject(i).get("tagline").toString().getBytes("utf-8"), "utf-8");
しかし、以下は
String j_post = new String((byte[]) "\u00e5".getBytes("utf-8"), "utf-8");
これを修正するにはどうすればよいですか?
更新:JSONObjectとしてキャストする前にエンコーディングを修正しようとしましたが、まだ機能しません。
json = new JSONObject(new String((byte[]) jsonContent.getBytes("utf-8"), "utf-8"));
JSONArray j_posts = json.getJSONArray("posts");
for (int i = 0; i<j_posts.length();i++){
//[String(byte[] data)][2]
String j_post =j_posts.getJSONObject(i).get("tagline").toString();
post_data.add(new Post(j_post));
}
Web サーバーからの応答として文字列を取得していることに注意してください。