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

locale.normalize

Prev: locale.localeconv | Up: locale | Next: locale.setlocale
Rel: locale.atof, locale.atoi, locale.currency, locale.Error
Ref: docs.python.org — locale.normalize
Tags: #public #python3 #stdlib #locale


Import

import locale
from locale import normalize

Signature & Overview

locale.normalize(localename)

Returns a normalized locale code for the given locale name.

Usage

import locale

assert "UTF-8" in locale.normalize("en_US.utf8") or "utf" in locale.normalize("en_US.utf8").lower()

Gotchas

REPL Inspect

from locale import normalize
help(normalize)

Linked from

Related notes