On this page
  1. unicodedata.normalize
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

unicodedata.normalize

Prev: unicodedata.name | Up: unicodedata | Next: unicodedata.numeric
Rel: unicodedata.bidirectional, unicodedata.category, unicodedata.combining, unicodedata.decimal
Ref: docs.python.org — unicodedata.normalize
Tags: #public #python3 #stdlib #unicodedata


Import

import unicodedata
from unicodedata import normalize

Signature & Overview

unicodedata.normalize(form, unistr, /)

Return the normal form 'form' for the Unicode string unistr.

Usage

import unicodedata

composed = 'café'
decomposed = 'cafe\u0301'
assert composed != decomposed
assert unicodedata.normalize('NFC', decomposed) == composed

Gotchas

REPL Inspect

from unicodedata import normalize
help(normalize)

Linked from

Related notes