Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / intl / uconv / nsIScriptableUConv.idl
blob8dc59ae1dbd04dfb0636da8cb3db9b5da150a54f
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;
10 /**
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
14 * in JavaScript.
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.
21 * @created 8/Jun/2000
22 * @author Makoto Kato [m_kato@ga2.so-net.ne.jp]
24 [scriptable, uuid(f36ee324-5c1c-437f-ba10-2b4db7a18031)]
25 interface nsIScriptableUnicodeConverter : nsISupports
27 /**
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);
34 /**
35 * Returns the terminator string.
36 * Should be called after ConvertFromUnicode() and appended to that
37 * function's return value.
39 ACString Finish();
41 /**
42 * Converts the data from one Charset to Unicode.
44 AString ConvertToUnicode(in ACString aSrc);
46 /**
47 * Current character set.
49 * @throw NS_ERROR_UCONV_NOCONV
50 * The requested charset is not supported.
52 attribute ACString charset;
54 /**
55 * Meaningless
57 attribute boolean isInternal;