nsIScriptableUConv.idl (1738B)
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/. */ 5 6 #include "nsISupports.idl" 7 8 interface nsIInputStream; 9 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. 15 * 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. 20 * 21 * @created 8/Jun/2000 22 * @author Makoto Kato [m_kato@ga2.so-net.ne.jp] 23 */ 24 [scriptable, uuid(f36ee324-5c1c-437f-ba10-2b4db7a18031)] 25 interface nsIScriptableUnicodeConverter : nsISupports 26 { 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. 31 */ 32 ACString ConvertFromUnicode(in AString aSrc); 33 34 /** 35 * Returns the terminator string. 36 * Should be called after ConvertFromUnicode() and appended to that 37 * function's return value. 38 */ 39 ACString Finish(); 40 41 /** 42 * Converts the data from one Charset to Unicode. 43 */ 44 AString ConvertToUnicode(in ACString aSrc); 45 46 /** 47 * Current character set. 48 * 49 * @throw NS_ERROR_UCONV_NOCONV 50 * The requested charset is not supported. 51 */ 52 attribute ACString charset; 53 54 /** 55 * Meaningless 56 */ 57 attribute boolean isInternal; 58 };