Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
AIGC-Audio
/
AudioGPT
like
289
Build error
App
Files
Files
Community
8
17767d6
AudioGPT
/
text_to_speech
/
utils
/
text
/
encoding.py
lmzjms
Upload 591 files
9206300
over 1 year 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