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
0e406d9f
Commit
0e406d9f
authored
Jul 27, 2022
by
AnimeGitB
Committed by
Melledy
Jul 28, 2022
Browse files
Add explicit encoding on manage_languages.py for windows users
parent
b80126fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
manage_languages.py
View file @
0e406d9f
...
@@ -23,7 +23,7 @@ def ppprint(data):
...
@@ -23,7 +23,7 @@ def ppprint(data):
class
JsonHelpers
:
class
JsonHelpers
:
@
staticmethod
@
staticmethod
def
load
(
filename
:
str
)
->
dict
:
def
load
(
filename
:
str
)
->
dict
:
with
open
(
filename
,
'r'
)
as
file
:
with
open
(
filename
,
'r'
,
encoding
=
'utf-8'
)
as
file
:
return
json
.
load
(
file
)
return
json
.
load
(
file
)
@
staticmethod
@
staticmethod
...
@@ -117,7 +117,7 @@ class LanguageManager:
...
@@ -117,7 +117,7 @@ class LanguageManager:
for
file
in
files
:
for
file
in
files
:
if
file
.
rpartition
(
'.'
)[
-
1
]
in
SOURCE_EXTENSIONS
:
if
file
.
rpartition
(
'.'
)[
-
1
]
in
SOURCE_EXTENSIONS
:
filename
=
os
.
path
.
join
(
root
,
file
)
filename
=
os
.
path
.
join
(
root
,
file
)
with
open
(
filename
,
'r'
)
as
f
:
with
open
(
filename
,
'r'
,
encoding
=
'utf-8'
)
as
f
:
data
=
f
.
read
()
# Loads in entire file at once
data
=
f
.
read
()
# Loads in entire file at once
for
k
in
self
.
TRANSLATION_KEY
.
findall
(
data
):
for
k
in
self
.
TRANSLATION_KEY
.
findall
(
data
):
used
.
add
(
k
)
used
.
add
(
k
)
...
...
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