Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
yerfor
/
SyntaSpeech
like
4
Build error
App
Files
Files
Community
1
Fetching metadata from the HF Docker repository...
08c2768
SyntaSpeech
/
utils
/
text
/
encoding.py
yerfor
init
22871e7
almost 3 years ago
raw
Copy download link
history
blame
Safe
207 Bytes
import
chardet
def
get_encoding
(
file
):
with
open
(file,
'rb'
)
as
f:
encoding = chardet.detect(f.read())[
'encoding'
]
if
encoding ==
'GB2312'
:
encoding =
'GB18030'
return
encoding