B2G/gecko/dom/mobilemessage/src/ril/WspPduHelper.jsm
/**
   * @param data
   *        A wrapped object containing raw PDU data.
   *
   * @return A object with a string property `charset` and a optional integer
   *         property `q`.
   *
   * @throws NotWellKnownEncodingError if decoded well-known charset number is
   *         not registered or supported.
   */
@param data
A wrapped object containing raw PDU data.

@return A object with a string property `charset` and a optional integer
property `q`.

@throws NotWellKnownEncodingError if decoded well-known charset number is
not registered or supported.
@param data A wrapped object containing raw PDU data . @return A object with a string property ` charset ` and a optional integer property ` q ` . @throws NotWellKnownEncodingError if decoded well - known charset number is not registered or supported .
function decodeConstrainedCharset(data) {
    let begin = data.offset;
    try {
      return this.decodeAnyCharset(data);
    } catch (e) {}
    data.offset = begin;
    let numOrStr = ConstrainedEncoding.decode(data);
    if (typeof numOrStr == "string") {
      return {charset: numOrStr};
    }
    let charset = numOrStr;
    let entry = WSP_WELL_KNOWN_CHARSETS[charset];
    if (!entry) {
      throw new NotWellKnownEncodingError(
        "Constrained-charset: not well known charset: " + charset);
    }
    return {charset: entry.name};
  }
function decodeConstrainedCharset ( data ) { let begin = data . offset ; try { return this . decodeAnyCharset ( data ) ; } catch ( e ) { } data . offset = begin ; let numOrStr = ConstrainedEncoding . decode ( data ) ; if ( typeof numOrStr == "string" ) { return { charset : numOrStr } ; } let charset = numOrStr ; let entry = WSP_WELL_KNOWN_CHARSETS [ charset ] ; if ( ! entry ) { throw new NotWellKnownEncodingError ( "Constrained-charset: not well known charset: " + charset ) ; } return { charset : entry . name } ; }
@param data
        A wrapped object containing raw PDU data.
@param data A wrapped object containing raw PDU data .