mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-11-28 13:36:06 +01:00
Add UTF-8 CharSet for file writer to avoid issues with incorrect char saving.
This commit is contained in:
parent
25f20ce779
commit
902a1993a2
@ -7,9 +7,10 @@ import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileWriter;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
@ -297,7 +298,8 @@ public class ChallengesImportManager
|
||||
defaultChallenges.setLevelList(levelList);
|
||||
defaultChallenges.setVersion(this.addon.getDescription().getVersion());
|
||||
|
||||
BufferedWriter writer = new BufferedWriter(new FileWriter(defaultFile, false));
|
||||
BufferedWriter writer = new BufferedWriter(
|
||||
new OutputStreamWriter(new FileOutputStream(defaultFile), StandardCharsets.UTF_8));
|
||||
writer.write(Objects.requireNonNull(
|
||||
new DefaultJSONHandler(this.addon).toJsonString(defaultChallenges)));
|
||||
writer.close();
|
||||
|
Loading…
Reference in New Issue
Block a user