0
我需要使用UTF-8將字節數組中的每個字節b轉換爲字符串。我可以使用UTF-8將整個字節數組轉換爲字符串。請幫助。下面是我的代碼,它有字節數組的緩衝區。使用UTF-8將單個字節從字節數組轉換爲字符串
String str = new String(buffer, "UTF-8");
// convert the array of bytes to characters using the default encoding.
Log.d("es.pymasde.blueterm",str);
// for each byte in the buffer(byte array)
for(byte b:buffer)
{
//Here I need to convert Each Byte b to string using UTF-8
}
我在網上找到它,但它沒有幫助我,因爲我需要使用UTF-8解碼字節。 – coder 2014-12-04 05:09:06