unicodedata.is_normalized
Prev: unicodedata.east_asian_width | Up: unicodedata | Next: unicodedata.lookup
Rel: unicodedata.bidirectional, unicodedata.category, unicodedata.combining, unicodedata.decimal
Ref: docs.python.org — unicodedata.is_normalized
Tags: #public #python3 #stdlib #unicodedata
Import
import unicodedata
from unicodedata import is_normalized
Signature & Overview
unicodedata.is_normalized(form, unistr, /)
Return whether the Unicode string unistr is in the normal form 'form'.
Usage
import unicodedata
assert unicodedata.is_normalized('NFC', 'café') is True
assert unicodedata.is_normalized('NFC', 'cafe\u0301') is False
Gotchas
- Faster than
normalize(form, s) == sbecause it returns early without allocating a new string.
REPL Inspect
from unicodedata import is_normalized
help(is_normalized)
Linked from
Related notes
- tuts/python3/stdlib_module/unicodedata/east_asian_width Linked here; links to this page; shared tags: #stdlib, #unicodedata
- tuts/python3/stdlib_module/unicodedata/lookup Linked here; links to this page; shared tags: #stdlib, #unicodedata
- tuts/python3/stdlib_module/unicodedata Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/unicodedata/bidirectional Linked here; shared tags: #stdlib, #unicodedata
- tuts/python3/stdlib_module/unicodedata/category Linked here; shared tags: #stdlib, #unicodedata
- tuts/python3/stdlib_module/unicodedata/combining Linked here; shared tags: #stdlib, #unicodedata
- tuts/python3/stdlib_module/unicodedata/decimal Linked here; shared tags: #stdlib, #unicodedata
- tuts/python3/stdlib_module/unicodedata/decomposition shared tags: #stdlib, #unicodedata
- tuts/python3/stdlib_module/unicodedata/digit shared tags: #stdlib, #unicodedata
- tuts/python3/stdlib_module/unicodedata/mirrored shared tags: #stdlib, #unicodedata