libere-tes-chaine-de-mots/import_data/utils/convert_encoding_meta.py
2024-07-18 20:04:51 -04:00

7 lines
200 B
Python

import re
def convert_encoding_meta(text):
conv_text = re.sub(r'[\xc2-\xf4][\x80-\xbf]+',
lambda m: m.group(0).encode('latin1').decode('utf8'), text)
return conv_text