Perform case-insensitive comparison of two identifiers, using the recommended algorithm from Unicode Technical Report 36, section 2.11.2(B)(2).
(s1, s2)
| 21 | |
| 22 | |
| 23 | def _unicode_ci_compare(s1, s2): |
| 24 | """ |
| 25 | Perform case-insensitive comparison of two identifiers, using the |
| 26 | recommended algorithm from Unicode Technical Report 36, section |
| 27 | 2.11.2(B)(2). |
| 28 | """ |
| 29 | return ( |
| 30 | unicodedata.normalize("NFKC", s1).casefold() |
| 31 | == unicodedata.normalize("NFKC", s2).casefold() |
| 32 | ) |
| 33 | |
| 34 | |
| 35 | class ReadOnlyPasswordHashWidget(forms.Widget): |