mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 20:33:07 +08:00
CB-453: FileWriter.append - Chinese characters are not appended to the file correctly
This commit is contained in:
parent
5d43835db8
commit
cb473dfed4
@ -980,16 +980,16 @@ public class FileUtils extends Plugin {
|
|||||||
append = true;
|
append = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
byte [] rawData = data.getBytes();
|
byte [] rawData = data.getBytes();
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(rawData);
|
ByteArrayInputStream in = new ByteArrayInputStream(rawData);
|
||||||
FileOutputStream out = new FileOutputStream(filename, append);
|
FileOutputStream out = new FileOutputStream(filename, append);
|
||||||
byte buff[] = new byte[rawData.length];
|
byte buff[] = new byte[rawData.length];
|
||||||
in.read(buff, 0, buff.length);
|
in.read(buff, 0, buff.length);
|
||||||
out.write(buff, 0, rawData.length);
|
out.write(buff, 0, rawData.length);
|
||||||
out.flush();
|
out.flush();
|
||||||
out.close();
|
out.close();
|
||||||
|
|
||||||
return data.length();
|
return rawData.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user