B2G/gecko/toolkit/devtools/webconsole/NetworkHelper.jsm
/**
   * Converts aText with a given aCharset to unicode.
   *
   * @param string aText
   *        Text to convert.
   * @param string aCharset
   *        Charset to convert the text to.
   * @returns string
   *          Converted text.
   */
Converts aText with a given aCharset to unicode.
@param string aText
Text to convert.
@param string aCharset
Charset to convert the text to.
@returns string
Converted text.
Converts aText with a given aCharset to unicode . @param string aText Text to convert . @param string aCharset Charset to convert the text to . @returns string Converted text .
function NH_convertToUnicode(aText, aCharset)
  {
    if (!aCharset) {
      return aText;
    }
    let conv = Cc["@mozilla.org/intl/scriptableunicodeconverter"].
               createInstance(Ci.nsIScriptableUnicodeConverter);
    conv.charset = aCharset;
    try {
      return conv.ConvertToUnicode(aText);
    }
    catch (ex) {
      return aText;
    }
  }
function NH_convertToUnicode ( aText , aCharset ) { if ( ! aCharset ) { return aText ; } let conv = Cc [ "@mozilla.org/intl/scriptableunicodeconverter" ] . createInstance ( Ci . nsIScriptableUnicodeConverter ) ; conv . charset = aCharset ; try { return conv . ConvertToUnicode ( aText ) ; } catch ( ex ) { return aText ; } }
Converts aText with a given aCharset to unicode.
Converts aText with a given aCharset to unicode .