Closed lixuezhi001 closed 1 year ago
It should be a encoding issue because this package use default encodings to extract the character .
You can try the code below and set the encoding which your data used
import xport.v56
from xport.v56 import _encoding
with _encoding(data="utf-8", metadata="utf-8"):
with open('adae.xpt', 'rb') as f:
library = xport.v56.load(f)
@caov2021 Thanks for helping!
Answered.
when i open xpt files ,The program occur this problem
label=tokens[5].strip(b'\x00').decode(TEXT_METADATA_ENCODING).rstrip(), UnicodeDecodeError: 'ascii' codec can't decode byte 0xd1 in position 0: ordinal not in range(128) i use python3.9.0 please help me,thanks!