Windows 10
# -*- coding: utf-8 -*- import json namefav = input("Введите название favorites:") with open(namefav, 'r', encoding='utf-8') as file: data = file.read() j = json.loads(data) file = open('playlist.m3u','a') for x in j: j2 = json.loads(x['data']) url = j2['url'] title = j2['title'] file.writelines('#EXTINF:-1,'+title+'\n') file.writelines(url+'\n') print('Готово. Смотрим - playlist.m3u') file.close() """ Скрипт создаёт плейлист (m3u) - из файлов (fav) папки favorites плагина E2iStream. """
file.writelines('#EXTINF:-1,'+title+'\n')
File “C:\Python\lib\encodings\cp1251.py”, line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)
UnicodeEncodeError: ‘charmap’ codec can't encode character ‘\U0001f41e’ in position 0: character maps to <undefined>
Как это исправить ?