Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
95c6b948
Commit
95c6b948
authored
Apr 22, 2022
by
Melledy
Committed by
GitHub
Apr 22, 2022
Browse files
Merge pull request #108 from fumbling644o/development
GM handbook: Explicitly load and save UTF-8
parents
dff860e2
215ee2a3
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/tools/Tools.java
View file @
95c6b948
...
@@ -3,6 +3,7 @@ package emu.grasscutter.tools;
...
@@ -3,6 +3,7 @@ package emu.grasscutter.tools;
import
java.io.FileReader
;
import
java.io.FileReader
;
import
java.io.FileWriter
;
import
java.io.FileWriter
;
import
java.io.PrintWriter
;
import
java.io.PrintWriter
;
import
java.nio.charset.StandardCharsets
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -30,13 +31,13 @@ public final class Tools {
...
@@ -30,13 +31,13 @@ public final class Tools {
ResourceLoader
.
loadResources
();
ResourceLoader
.
loadResources
();
Map
<
Long
,
String
>
map
;
Map
<
Long
,
String
>
map
;
try
(
FileReader
fileReader
=
new
FileReader
(
Utils
.
toFilePath
(
Grasscutter
.
getConfig
().
RESOURCE_FOLDER
+
"TextMap/TextMapEN.json"
)))
{
try
(
FileReader
fileReader
=
new
FileReader
(
Utils
.
toFilePath
(
Grasscutter
.
getConfig
().
RESOURCE_FOLDER
+
"TextMap/TextMapEN.json"
)
,
StandardCharsets
.
UTF_8
))
{
map
=
Grasscutter
.
getGsonFactory
().
fromJson
(
fileReader
,
new
TypeToken
<
Map
<
Long
,
String
>>()
{}.
getType
());
map
=
Grasscutter
.
getGsonFactory
().
fromJson
(
fileReader
,
new
TypeToken
<
Map
<
Long
,
String
>>()
{}.
getType
());
}
}
List
<
Integer
>
list
;
List
<
Integer
>
list
;
String
fileName
=
"./GM Handbook.txt"
;
String
fileName
=
"./GM Handbook.txt"
;
try
(
FileWriter
fileWriter
=
new
FileWriter
(
fileName
);
PrintWriter
writer
=
new
PrintWriter
(
file
Writer
))
{
try
(
PrintWriter
writer
=
new
PrintWriter
(
file
Name
,
StandardCharsets
.
UTF_8
))
{
DateTimeFormatter
dtf
=
DateTimeFormatter
.
ofPattern
(
"yyyy/MM/dd HH:mm:ss"
);
DateTimeFormatter
dtf
=
DateTimeFormatter
.
ofPattern
(
"yyyy/MM/dd HH:mm:ss"
);
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
now
=
LocalDateTime
.
now
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment