mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 14:19:48 +00:00
LibUnicode: Support IgnorePunnycode option in ToAscii algorithm
This was introduced in UTS 46 revision 31.
This commit is contained in:
parent
5dfb825c5c
commit
923ab8658e
Notes:
github-actions[bot]
2024-12-05 16:30:43 +00:00
Author: https://github.com/shannonbooth
Commit: 923ab8658e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2675
2 changed files with 11 additions and 0 deletions
|
@ -45,12 +45,17 @@ ErrorOr<String> to_ascii(Utf8View domain_name, ToAsciiOptions const& options)
|
|||
errors &= ~UIDNA_ERROR_LEADING_HYPHEN;
|
||||
errors &= ~UIDNA_ERROR_TRAILING_HYPHEN;
|
||||
}
|
||||
|
||||
if (options.verify_dns_length == VerifyDnsLength::No) {
|
||||
errors &= ~UIDNA_ERROR_EMPTY_LABEL;
|
||||
errors &= ~UIDNA_ERROR_LABEL_TOO_LONG;
|
||||
errors &= ~UIDNA_ERROR_DOMAIN_NAME_TOO_LONG;
|
||||
}
|
||||
|
||||
if (options.ignore_invalid_punycode == IgnoreInvalidPunycode::Yes) {
|
||||
errors &= ~UIDNA_ERROR_PUNYCODE;
|
||||
}
|
||||
|
||||
if (icu_failure(status) || errors != 0)
|
||||
return Error::from_string_literal("Unable to convert domain to ASCII");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue