Source code

Revision control

Copy as Markdown

Other Tools

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
/**
* IDN (Internationalized Domain Name) support. Provides facilities
* for manipulating IDN hostnames according to UTS #46 as parametrized
* by the WHATWG URL Standard.
*
*
*/
[scriptable, uuid(a592a60e-3621-4f19-a318-2bf233cfad3e)]
interface nsIIDNService : nsISupports
{
/**
* The UTS #46 ToASCII operation as parametrized by the WHATWG URL Standard,
* except allows any ASCII character that has a glyph.
*
* Use this function to prepare a host name for network protocols.
*
* Do not try to optimize and avoid calling this function if you already
* have ASCII. This function optimizes internally, and calling it is
* required for correctness!
*
* The function is available to C++ callers as `NS_DomainToASCIIAllowAnyGlyphfulASCII`.
*
* Rust callers that don't happen to be using XPCOM strings are better
* off using the `idna` crate directly.
*/
ACString convertUTF8toACE(in AUTF8String input);
/**
* The UTS #46 ToUnicode operation as parametrized by the WHATWG URL Standard,
* except allows any ASCII character that has a glyph, except potentially misleading
* labels are treated according to ToASCII instead.
*
* Use this function to prepare a host name for display to the user.
*
* The function is available to C++ callers as `NS_DomainToDisplayAllowAnyGlyphfulASCII`.
*
* The function is available to privileged JavaScript callers via
* nsIIDNService.
*
* Rust callers that don't happen to be using XPCOM strings are better
* off using the `idna` crate directly. (See `idna_glue` for what policy
* closure to use.)
*/
AUTF8String convertToDisplayIDN(in AUTF8String input);
/**
* The UTS #46 ToUnicode operation as parametrized by the WHATWG URL Standard,
* except allows any ASCII character that has a glyph.
*
* It's most likely INCORRECT to call this function, and `NS_DomainToDisplay`
* should typically be called instead. Please avoid adding new callers, so
* that this conversion could be removed entirely!
*
* The function is available to C++ callers as `NS_DomainToUnicodeAllowAnyGlyphfulASCII`.
*
* Rust callers that don't happen to be using XPCOM strings are better
* off using the `idna` crate directly.
*/
AUTF8String convertACEtoUTF8(in ACString input);
/**
* DO NOT USE! Checks if the input string is ACE encoded or not.
*/
boolean isACE(in ACString input);
};