Exception:
Traceback (most recent call last): File "signal-message-exporter.py", line 310, in <module> root.writexml(f, encoding="utf-8", standalone="yes") File "\lib\xml\dom\minidom.py", line 1828, in writexml node.writexml(writer, indent, addindent, newl) File "\lib\xml\dom\minidom.py", line 897, in writexml node.writexml(writer, indent+addindent, addindent, newl) File "\lib\xml\dom\minidom.py", line 886, in writexml _write_data(writer, attrs[a_name].value) File "\lib\xml\dom\minidom.py", line 308, in _write_data writer.write(data) File "\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 '\u263a' in position 0: character maps to <undefined>
To fix this, simply open the file with the correct encoding by adding ", encoding="utf-8"":
with open("sms-backup-restore.xml", "w", encoding="utf-8") as f:
On Windows 10:
Exception:
Traceback (most recent call last): File "signal-message-exporter.py", line 310, in <module> root.writexml(f, encoding="utf-8", standalone="yes") File "\lib\xml\dom\minidom.py", line 1828, in writexml node.writexml(writer, indent, addindent, newl) File "\lib\xml\dom\minidom.py", line 897, in writexml node.writexml(writer, indent+addindent, addindent, newl) File "\lib\xml\dom\minidom.py", line 886, in writexml _write_data(writer, attrs[a_name].value) File "\lib\xml\dom\minidom.py", line 308, in _write_data writer.write(data) File "\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 '\u263a' in position 0: character maps to <undefined>
To fix this, simply open the file with the correct encoding by adding ", encoding="utf-8"":
with open("sms-backup-restore.xml", "w", encoding="utf-8") as f: