WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

nsIIDNService

IID:a592a60e-3621-4f19-a318-2bf233cfad3e
Inherits From:nsISupports

nsIIDNService interface.

IDN (Internationalized Domain Name) support. Provides facilities for manipulating IDN hostnames according to the specification set forth by the IETF.

IDN effort: http://www.ietf.org/html.characters/idn-charter.html http://www.i-dns.net

IDNA specification: http://search.ietf.org/internet-drafts/draft-ietf-idn-idna-06.txt

This interface is intended to be used as a service. To create an object implementing this interface:

var obj = Components.classes["@mozilla.org/network/idn-service;1"].
            getService(Components.interfaces.nsIIDNService);

This interface is implemented by the following components:


Methods

AUTF8String convertACEtoUTF8 ( ACString input ) AUTF8String convertToDisplayIDN ( AUTF8String input , out PRBool isASCII ) ACString convertUTF8toACE ( AUTF8String input ) PRBool isACE ( ACString input ) AUTF8String normalize ( AUTF8String input )

AUTF8String convertACEtoUTF8 ( ACString input )

This is the ToUnicode operation as specified in the IDNA proposal, with an additional step to encode the result in UTF-8. It takes an ACE-encoded hostname and performs ToUnicode to it, then encodes the resulting string into UTF8.

Arguments:
input

AUTF8String convertToDisplayIDN ( AUTF8String input , out PRBool isASCII )

Normalizes and converts a host to UTF-8 if the host is in the IDN whitelist, otherwise converts it to ACE. This is useful for display purposes and to ensure an encoding consistent with nsIURI::GetHost(). If the result is ASCII or ACE encoded, isASCII will be true.

Arguments:
input
isASCII

ACString convertUTF8toACE ( AUTF8String input )

Prepares the input hostname according to IDNA ToASCII operation, the input hostname is assumed to be UTF8-encoded.

Arguments:
input

PRBool isACE ( ACString input )

Checks if the input string is ACE encoded or not.

Arguments:
input

AUTF8String normalize ( AUTF8String input )

Performs the unicode normalization needed for hostnames in IDN, for callers that want early normalization.

Arguments:
input

Reference documentation is generated from Mozilla's source.

Copyright © 1999-2006 XULPlanet.com