1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include
"nsISupports.idl"
8 interface nsIInputStream
;
11 * In new code, please use the WebIDL TextDecoder and TextEncoder
12 * instead. They represent bytes as Uint8Array (or as view to such
13 * array), which is the current best practice for representing bytes
16 * This interface converts between UTF-16 in JavaScript strings
17 * and bytes transported as the unsigned value of each byte
18 * transported in a code unit of the same numeric value in
19 * a JavaScript string.
22 * @author Makoto Kato [m_kato@ga2.so-net.ne.jp]
24 [scriptable
, uuid(f36ee324
-5c1c
-437f
-ba10
-2b4db7a18031
)]
25 interface nsIScriptableUnicodeConverter
: nsISupports
28 * Converts the data from Unicode to one Charset.
29 * Returns the converted string. After converting, Finish should be called
30 * and its return value appended to this return value.
32 ACString ConvertFromUnicode
(in AString aSrc
);
35 * Returns the terminator string.
36 * Should be called after ConvertFromUnicode() and appended to that
37 * function's return value.
42 * Converts the data from one Charset to Unicode.
44 AString ConvertToUnicode
(in ACString aSrc
);
47 * Current character set.
49 * @throw NS_ERROR_UCONV_NOCONV
50 * The requested charset is not supported.
52 attribute ACString charset
;
57 attribute
boolean isInternal
;