Interface nsIScriptableUnicodeConverterType

In new code, please use the WebIDL TextDecoder and TextEncoder instead. They represent bytes as Uint8Array (or as view to such array), which is the current best practice for representing bytes in JavaScript.

This interface converts between UTF-16 in JavaScript strings and bytes transported as the unsigned value of each byte transported in a code unit of the same numeric value in a JavaScript string.

Created

8/Jun/2000

Author

Makoto Kato [m_kato@ga2.so-net.ne.jp]

Hierarchy

Properties

charset: string

Current character set.

Throw

NS_ERROR_UCONV_NOCONV The requested charset is not supported.

isInternal: boolean

Meaningless

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • 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.

    Parameters

    • aSrc: string

    Returns string

  • Converts the data from one Charset to Unicode.

    Parameters

    • aSrc: string

    Returns string

  • Returns the terminator string. Should be called after ConvertFromUnicode() and appended to that function's return value.

    Returns string

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Convert a unicode string to an array of bytes. Finish does not need to be called.

    Parameters

    • aString: string
    • aLen: number
    • aData: number

    Returns void

  • 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.

    Parameters

    • aString: string

    Returns nsIInputStream

Generated using TypeDoc