Ada 4.1.1
Fast spec-compliant URL parser
Loading...
Searching...
No Matches
to_unicode.h
Go to the documentation of this file.
1#ifndef ADA_IDNA_TO_UNICODE_H
2#define ADA_IDNA_TO_UNICODE_H
3
4#include <string>
5#include <string_view>
6
7#include "ada/idna/limits.h"
8
9namespace ada::idna {
10
11// UTS #46 ToUnicode. Never fails per the standard: on step failure the original
12// label is kept. Inputs longer than max_domain_input_bytes are returned
13// unchanged as a safety measure under untrusted input.
14std::string to_unicode(std::string_view input);
15
16// Writes into `out`. Returns false only if the input exceeds
17// max_domain_input_bytes (out is left empty). Otherwise always returns true
18// (ToUnicode does not fail).
19[[nodiscard]] bool to_unicode(std::string_view input, std::string& out);
20
21} // namespace ada::idna
22
23#endif // ADA_IDNA_TO_UNICODE_H
std::string to_unicode(std::string_view input)