Module uts46

Source
Expand description

This module provides the lower-level API for UTS 46.

Uts46::process is the core that the other convenience methods build on.

UTS 46 flags map to this API as follows:

  • CheckHyphens - true: Hyphens::Check, false: Hyphens::Allow; the WHATWG URL Standard sets this to false for normal (non-conformance-checker) user agents.
  • CheckBidi - Always true; cannot be configured, since this flag is true even when WHATWG URL Standard beStrict is false.
  • CheckJoiners - Always true; cannot be configured, since this flag is true even when WHATWG URL Standard beStrict is false.
  • UseSTD3ASCIIRules - true: AsciiDenyList::STD3, false: AsciiDenyList::EMPTY; however, the check the WHATWG URL Standard performs right after the UTS 46 invocation corresponds to AsciiDenyList::URL.
  • Transitional_Processing - Always false but could be implemented as a preprocessing step. This flag is deprecated and for Web purposes the transition is over in the sense that all of Firefox, Safari, or Chrome set this flag to false.
  • VerifyDnsLength - true: DnsLength::Verify, false: DnsLength::Ignore; the WHATWG URL Standard sets this to false for normal (non-conformance-checker) user agents.
  • IgnoreInvalidPunycode - Always false; cannot be configured. (Not yet covered by the WHATWG URL Standard, but 2 out of 3 major browser clearly behave as if this was false).

Structsยง

AsciiDenyList
The ASCII deny list to be applied.
Uts46
An implementation of UTS #46.

Enumsยง

AlreadyAsciiLabel ๐Ÿ”’
DnsLength
The UTS 46 VerifyDNSLength flag.
ErrorPolicy
Policy for customizing behavior in case of an error.
Hyphens
The CheckHyphens mode.
ProcessingError
The failure outcome of Uts46::process
ProcessingSuccess
The success outcome of Uts46::process
PunycodeClassification ๐Ÿ”’
RtlNumeralState ๐Ÿ”’
For keeping track of what kind of numerals have been seen in an RTL label.

Constantsยง

DOT_MASK ๐Ÿ”’
The mask for the ASCII dot.
GLYPHLESS_MASK ๐Ÿ”’
Bit set for glyphless ASCII.
PUNYCODE_DECODE_MAX_INPUT_LENGTH ๐Ÿ”’
ICU4C-compatible constraint. https://unicode-org.atlassian.net/browse/ICU-13727
PUNYCODE_ENCODE_MAX_INPUT_LENGTH ๐Ÿ”’
ICU4C-compatible constraint. (Note: ICU4C measures UTF-16 and we measure UTF-32. This means that we allow longer non-BMP inputs. For this implementation, the denial-of-service scaling does not depend on BMP vs. non-BMP: only the scalar values matter.)
PUNYCODE_PREFIX ๐Ÿ”’
PUNYCODE_PREFIX_MASK ๐Ÿ”’
UPPER_CASE_MASK ๐Ÿ”’
Bit set for upper-case ASCII.

Functionsยง

apply_ascii_deny_list_to_lower_cased_unicode ๐Ÿ”’
apply_ascii_deny_list_to_potentially_upper_case_ascii ๐Ÿ”’
check_hyphens ๐Ÿ”’
classify_for_punycode ๐Ÿ”’
glyphless_mask ๐Ÿ”’
Computes the mask for glyphless ASCII.
has_punycode_prefix ๐Ÿ”’
in_inclusive_range8 ๐Ÿ”’
in_inclusive_range_char ๐Ÿ”’
is_ascii ๐Ÿ”’
is_passthrough_ascii_label ๐Ÿ”’
ldh_mask ๐Ÿ”’
Computes the ASCII deny list for STD3 ASCII rules.
split_ascii_fast_path_prefix ๐Ÿ”’
upper_case_mask ๐Ÿ”’
Computes the mask for upper-case ASCII.
verify_dns_length
Performs the VerifyDNSLength check on the output of the ToASCII operation.
write_punycode_label ๐Ÿ”’