community.general.unicode_normalize (8.5.0) — filter

Normalizes unicode strings to facilitate comparison of characters with normalized forms

| "added in version" 3.7.0 of community.general"

Authors: Andrew Pantuso (@Ajpantuso)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Normalizes unicode strings to facilitate comparison of characters with normalized forms.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Normalize unicode string
  ansible.builtin.set_fact:
    dictionary: "{{ 'ä' | community.general.unicode_normalize('NFKD') }}"

Inputs

    
form:
    choices:
    - NFC
    - NFD
    - NFKC
    - NFKD
    default: NFC
    description:
    - The normal form to use.
    - See U(https://docs.python.org/3/library/unicodedata.html#unicodedata.normalize)
      for details.
    type: string

_input:
    description: A unicode string.
    required: true
    type: string

Outputs

_value:
  description: The normalized unicode string of the specified normal form.
  type: string