Я пытаюсь заменить все вкладки пробелом, чтобы я мог поместить выделенный текст Coma в одну строку в другой файл. Теперь мой код выглядит следующим образом:UnicodeDecodeError by python regex
from __future__ import print_function
import re
import ast
f = open('sample_test.txt', 'r')
g = open('sample_test1.txt', 'w')
for line in f:
c = re.sub(r'\R', r' ', line.rstrip())
print (c, file = g)
f.close()
Сейчас проблема заключается в том, что я получаю эту ошибку:
UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 1944: character maps to <undefined>
Какая линия указывает на ошибку? –