mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-12 00:17:51 +00:00
Make sure to use utf-8 for bookmark reading as well as writing (#253)
This commit is contained in:
1 parent
8f7d698e7d
commit
ba77a63545
2 files changed
+10
-8
No files matched your search
@@ -32,6 +32,7 @@ import java.io.OutputStream;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -547,7 +548,7 @@ public class BookmarkPanel extends PanelWidget
|
||||
}
|
||||
|
||||
try (FileOutputStream output = new FileOutputStream(bookmarkFile)) {
|
||||
IOUtils.writeLines(strings, "\n", output, "UTF-8");
|
||||
IOUtils.writeLines(strings, "\n", output, StandardCharsets.UTF_8);
|
||||
} catch (IOException e) {
|
||||
NEIClientConfig.logger.error("Filed to save bookmarks list to file {}", bookmarkFile, e);
|
||||
}
|
||||
@@ -568,9 +569,9 @@ public class BookmarkPanel extends PanelWidget
|
||||
}
|
||||
|
||||
List<String> itemStrings;
|
||||
try (FileReader reader = new FileReader(bookmarkFile)) {
|
||||
try (FileInputStream reader = new FileInputStream(bookmarkFile)) {
|
||||
NEIClientConfig.logger.info("Loading bookmarks from file {}", bookmarkFile);
|
||||
itemStrings = IOUtils.readLines(reader);
|
||||
itemStrings = IOUtils.readLines(reader, StandardCharsets.UTF_8);
|
||||
} catch (IOException e) {
|
||||
NEIClientConfig.logger.error("Failed to load bookmarks from file {}", bookmarkFile, e);
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user