---
name: "Zonemaster::Engine::Normalization"
section: "3pm"
platform: "linux"
package: "libzonemaster-perl"
version: "7.1.0-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Zonemaster::Engine::Normalization"
---

# Zonemaster::Engine::Normalization(3pm)

utility functions for names normalization

## NAME

Zonemaster::Engine::Normalization - utility functions for names normalization

## SYNOPSIS

```
    use Zonemaster::Engine::Normalization;
    my ($errors, $final_domain) = normalize_name($domain);
```

## EXPORTED FUNCTIONS

- normalize\_label($label)

  Normalize a single label from a domain name.

  If the label is ASCII only, it is down cased, else it is converted according to IDNA2008.

  Downcasing of upper case non-ASCII characters, normalization to the Unicode NFC format and conversion from U-label to A-label is performed by libidn2 using "to\_idn($name, ...)" in Zonemaster::LDNS.

  Returns a tuple `"($errors: ArrayRef[Zonemaster::Engine::Normalization::Error], $alabel: String)"`.

  In case of errors, the returned label will be undefined. If the method succeeded an empty error array is returned.

- normalize\_name($name)

  Normalize a domain name.

  The normalization process is detailed in the normalization document \<https://github.com/zonemaster/zonemaster/blob/master/docs/specifications/tests/RequirementsAndNormalizationOfDomainNames.md\>.

  Returns a tuple `"($errors: ArrayRef[Zonemaster::Engine::Normalization::Error], $name: String)"`.

  In case of errors, the returned name will be undefined. If the method succeeded an empty error array is returned.
