nsISupports
Last changed in Gecko 1.9 (Firefox 3)Implemented by: @mozilla.org/network/idn-service;1
as a service:
var idnService = Components.classes["@mozilla.org/network/idn-service;1"] .getService(Components.interfaces.nsIIDNService);
AUTF8String convertACEtoUTF8(in ACString input); |
AUTF8String convertToDisplayIDN(in AUTF8String input, out boolean isASCII); |
ACString convertUTF8toACE(in AUTF8String input); |
boolean isACE(in ACString input); |
AUTF8String normalize(in AUTF8String input); |
Converts an ACE (ASCII Compatible Encoding) hostname into Unicode format, returning a UTF-8 format string. This combines two operations: running the RFC 3490 "ToUnicode" operation on the original string, then converting the resulting Unicode string into UTF-8 format.
AUTF8String convertACEtoUTF8( in ACString input );
input
The UTF-8 encoded equivalent of the hostname.
Normalizes a hostname into UTF-8 format if the hostname is in the IDN whitelist. If the hostname isn't in the whitelist, it's converted into ACE format. The resulting string is useful for display purposes, and ensures that the encoding is consistent with nsIURI.GetHost()
.
AUTF8String convertToDisplayIDN( in AUTF8String input, out boolean isASCII );
input
isASCII
true
if the result is ASCII or ACE encoded; otherwise it's false
.The display formatted hostname.
Converts the specified hostname from UTF-8 to ACE format, using the IDNA "ToASCII" algorithm.
ACString convertUTF8toACE( in AUTF8String input );
input
The ACE encoded version of the hostname.
Determines whether or not the specified hostname is ACE encoded.
boolean isACE( in ACString input );
input
Returns true
if the specified string is ACE encoded; otherwise, returns false
.
Performs the Unicode normalization needed for hostnames in IDN. This is useful if you need to normalize a hostname separately from converting it to display format.
AUTF8String normalize( in AUTF8String input );
input
The normalized hostname.