Bug 1866777 - Disable test_race_cache_with_network.js on windows opt for frequent...
[gecko.git] / netwerk / dns / nsIIDNService.idl
blob47ef56123755879a27d5a80fd6c1cdc23884414c
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "nsISupports.idl"
7 /**
8 * nsIIDNService interface.
10 * IDN (Internationalized Domain Name) support. Provides facilities
11 * for manipulating IDN hostnames according to the specification set
12 * forth by the IETF.
14 * IDN effort:
15 * http://www.ietf.org/html.characters/idn-charter.html
16 * http://www.i-dns.net
18 * IDNA specification:
19 * http://search.ietf.org/internet-drafts/draft-ietf-idn-idna-06.txt
22 [scriptable, uuid(a592a60e-3621-4f19-a318-2bf233cfad3e)]
23 interface nsIIDNService : nsISupports
25 /**
26 * Prepares the input hostname according to IDNA ToASCII operation,
27 * the input hostname is assumed to be UTF8-encoded.
29 ACString convertUTF8toACE(in AUTF8String input);
32 /**
33 * This is the ToUnicode operation as specified in the IDNA proposal,
34 * with an additional step to encode the result in UTF-8.
35 * It takes an ACE-encoded hostname and performs ToUnicode to it, then
36 * encodes the resulting string into UTF8.
38 AUTF8String convertACEtoUTF8(in ACString input);
40 /**
41 * Checks if the input string is ACE encoded or not.
43 boolean isACE(in ACString input);
45 /**
46 * Performs the unicode normalization needed for hostnames in IDN,
47 * for callers that want early normalization.
49 AUTF8String normalize(in AUTF8String input);
51 /**
52 * Normalizes and converts a host to UTF-8 if the host is in the IDN
53 * whitelist, otherwise converts it to ACE. This is useful for display
54 * purposes and to ensure an encoding consistent with nsIURI::GetHost().
55 * If the result is ASCII or ACE encoded, |isASCII| will be true.
57 AUTF8String convertToDisplayIDN(in AUTF8String input, out boolean isASCII);