Implemented by
This interface is a unicode encoder for use by scripts @created 8/Jun/2000 @author Makoto Kato [m_kato@ga2.so-net.ne.jp]
[scriptable, uuid(1ea19c6c-c59f-4fd7-9fc7-151e946baca0)]
interface nsIScriptableUnicodeConverter : nsISupports
Attributes
Current character set.
@throw NS_ERROR_UCONV_NOCONV
The requested charset is not supported.
attribute
string
charset
Methods
Converts an array of bytes to a unicode string.
AString
convertFromByteArray([const, array, size_is(aCount)] in octet aData, in unsigned long aCount)
Converts the data from Unicode to one Charset. Returns the converted string. After converting, Finish should be called and its return value appended to this return value.
ACString
ConvertFromUnicode(in AString aSrc)
Convert a unicode string to an array of bytes. Finish does not need to be called.
void
convertToByteArray(in AString aString, out unsigned long aLen, [array, size_is(aLen), retval] out octet aData)
Converts a unicode string to an input stream. The bytes in the stream are encoded according to the charset attribute. The returned stream will be nonblocking.
nsIInputStream
convertToInputStream(in AString aString)
Converts the data from one Charset to Unicode.
AString
ConvertToUnicode(in ACString aSrc)
Returns the terminator string. Should be called after ConvertFromUnicode() and appended to that function's return value.
ACString
Finish()
Compare to: