1

'''

def __on_comment(self, video_id, comment):
        self.producer.send('comments', bytes('{}\t{}'.format(video_id, comment), encoding='utf-8'))
        print(video_id, comment)

'''

why is it that whenever I run that line of code I get an error

line 17, in __on_comment print(video_id, comment) File "C:\Users\Hillary\AppData\Local\Programs\Python\Python310\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\u2764' in position 0: character maps to someone help me on how to fix such an error

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
hillz
  • 11
  • 2
  • Check this stack : https://stackoverflow.com/questions/27092833/unicodeencodeerror-charmap-codec-cant-encode-characters?rq=1 – Aman Raheja Aug 31 '22 at 13:39
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Aug 31 '22 at 13:52

0 Answers0