Skip to content

Commit

Permalink
Read comments using UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
tchristofferson committed Dec 23, 2024
1 parent a0f7f04 commit 0f28697
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private static void write(FileConfiguration defaultConfig, FileConfiguration cur
private static Map<String, String> parseComments(Plugin plugin, String resourceName, FileConfiguration defaultConfig) throws IOException {
//keys are in order
List<String> keys = new ArrayList<>(defaultConfig.getKeys(true));
BufferedReader reader = new BufferedReader(new InputStreamReader(plugin.getResource(resourceName)));
BufferedReader reader = new BufferedReader(new InputStreamReader(plugin.getResource(resourceName), StandardCharsets.UTF_8));
Map<String, String> comments = new LinkedHashMap<>();
StringBuilder commentBuilder = new StringBuilder();
KeyBuilder keyBuilder = new KeyBuilder(defaultConfig, SEPARATOR);
Expand Down
1 change: 1 addition & 0 deletions src/test/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ key-char: c
end-key: end key value
locked-name: <red><bold>锁定!
ignored-empty: {}
#Chinese comment 锁定
ignored-chinese:
test: 锁定
#Ending comment
Expand Down

1 comment on commit 0f28697

@tchristofferson
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes issue #35

Please sign in to comment.