Open scottb5612 opened 1 month ago
I added support for multiple encodings : ["utf-8", "utf-16", "latin1", "ansi"]
.
Let me know if version v0.2.3 this fixed your issue, if not please provide a minimal example causing the issue.
commit
It still fails, minimal example attached, along with my test program motivated by your README.md I had to renmae the test programs suffix, in order to be able to attach it Rename gedcom.py.txt getcom.py.txt test.txt to gedcom.py and run in the directory where test.txt is located.
Traceback (most recent call last):
File "/Users/baden/PycharmProjects/Utils/gedcom.py", line 6, in
I have a valid ged file However, it stats reveals nothing
{'head': 'None', 'submitters': 0, 'individuals': 0, 'families': 0, 'sources': 0, 'objects': 0, 'notes': 0, 'repositories': 0}
Verification also fails
verif = parser.verify() Traceback (most recent call last): File "", line 1, in
File "/Users/baden/.venv/3_env/lib/python3.12/site-packages/pygedcom/gedcom_parser.py", line 70, in verify
file = self.open()
^^^^^^^^^^^^^
File "/Users/baden/.venv/3_env/lib/python3.12/site-packages/pygedcom/gedcom_parser.py", line 46, in open
data = file.read()
^^^^^^^^^^^
File "", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfe in position 0: invalid start byte