Implement skinCharset option that allows to set the

encoding for skin files to something else than the
platform's file.encoding.
This commit is contained in:
hns 2004-06-12 21:00:19 +00:00
parent cf6d9b8330
commit f334900a79

View file

@ -97,8 +97,15 @@ public final class SkinFile implements Updatable {
}
private void read() {
String encoding = app.getProperty("skinCharset");
try {
FileReader reader = new FileReader(file);
Reader reader;
if (encoding == null) {
reader = new FileReader(file);
} else {
FileInputStream in = new FileInputStream(file);
reader = new InputStreamReader(in, encoding);
}
char[] c = new char[(int) file.length()];
int length = reader.read(c);