-4
我有一個字符串,它是通過一個很長的過程decoded/encoded/encrypted
(涉及file writing/reading
)。爲什麼我在Java String中有?
在解碼後,我的「明文」字符串開頭我有兩個奇怪的字符:
這是什麼?爲什麼在那裏?如何擺脫它?
謝謝。
編輯:
這是我寫的一個文件:
try {
FileOutputStream out = new FileOutputStream(filePath);
out.write(string.getBytes());
out.close();
} catch (Exception e) {
//handle exception
}
我認爲這是一個字節順序標記(BOM)http://stackoverflow.com/questions/2223882/whats-different-between-utf-8-and-utf-8-without-bom – Stewart
這可能是一個[BOM](https://en.wikipedia.org/wiki/Byte_order_mark),這是在你的文件寫作中創建的。顯示你的代碼。 – Kayaman
請務必在提問前閱讀此內容:http://stackoverflow.com/help/how-to-ask – tak3shi