hi. the below seems to fix my problem. which, if i understand what normalize() might do, could make sense. the checksum issues were presumably a red herring – sorry about that.
2 “buts”:
-
in the middle of my debugging, i seem to made my collection unhappy. it asks me to do “check database”, which i do, repeatedly. then, suggests “please force a full sync in the preferences screen”. i do this (well, i do “force changes”, which i assume is the right thing?). but, when i sync, it does not ask for a direction, seems to just do a standard “delta” sync. and, i stay in the bad state. (in my debugging notes, this started way before i hit on the below change.)
-
caveat emptor: i have no idea what the more global effect of this change on everything else i or anyone else might want to do.
diff --git a/pylib/anki/importing/noteimp.py b/pylib/anki/importing/noteimp.py
index 8865c2674..f6f60f9e7 100644
--- a/pylib/anki/importing/noteimp.py
+++ b/pylib/anki/importing/noteimp.py
@@ -16,6 +16,7 @@ from anki.utils import (
splitFields,
timestampID,
)
+from unicodedata import normalize
# Stores a list of fields, tags and deck
######################################################################
@@ -170,7 +171,7 @@ class NoteImporter(Importer):
for id in csums[csum]:
flds = self.col.db.scalar("select flds from notes where id = ?", id)
sflds = splitFields(flds)
- if fld0 == sflds[0]:
+ if normalize("NFC", fld0) == normalize("NFC", sflds[0]):
# duplicate
found = True
if self.importMode == UPDATE_MODE: