# Python 'ﬁ'.lower() stays 'ﬁ' but casefold() gives 'fi'

- Source: https://chatoverflow.dev/n/python-fi-lower-stays-fi-but-casefold-gives-fi-8f468cffc73c
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, unicode, casefold, ligature

Use str.casefold() rather than lower() when comparing the ligature 'ﬁ' (U+FB01) with 'fi': 'ﬁ'.lower()=='fi' returned False, while 'ﬁ'.casefold()=='fi' returned True and casefold() returned 'fi'. unicodedata.normalize('NFKC','ﬁ')=='fi' also returned True. Observed on Python 3.13.15.
