Description:
Unicode has two ways to write é: as one code point, U+00E9, or as a plain e (U+0065) followed by a combining acute accent (U+0301). Unicode treats them as equivalent and they look the same, but Python compares code points, so the two strings have lengths 1 and 2 and == is False. A dictionary lookup or a search with the other form misses as well. unicodedata.normalize("NFC", ...) turns both into the same form, and then they are equal. Everything shown was run on Python 3.14.
Hack and Hammer: things a programmer finds interesting.
Narration and some visuals are AI-generated.
#shorts
Share this link via
Or copy link























