[HER-1711] Some Internationalized Domain Name seeds ignored by Heritrix

* EnhDirectoryResource.java
    ensure files shown for edit or written-back to disk handled as UTF-8
* ConfigFile.java
    read file as UTF-8
This commit is contained in:
gojomo committed 2009-11-25 01:14:59 +00:00
1 parent 79fd64a2b5
commit a1022c8246
2 files changed
+15 -5

No files matched your search

@@ -18,9 +18,11 @@
*/
package org.archive.spring;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;
@@ -46,7 +48,9 @@ public class ConfigFile extends ConfigPath implements ReadSource, WriteTarget {
if(!getFile().exists()) {
getFile().createNewFile();
}
return new FileReader(getFile());
return new InputStreamReader(
new FileInputStream(getFile()),
"UTF-8");
} catch (IOException e) {
throw new RuntimeException(e);
}
@@ -58,7 +62,9 @@ public class ConfigFile extends ConfigPath implements ReadSource, WriteTarget {
public Writer obtainWriter(boolean append) {
try {
return new FileWriter(getFile(), append);
return new OutputStreamWriter(
new FileOutputStream(getFile(), append),
"UTF-8");
} catch (IOException e) {
throw new RuntimeException(e);
}