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`.
   */
@param data
A wrapped object containing raw PDU data.

@return A object with a string property `charset` and a optional integer
property `q`.
@param data A wrapped object containing raw PDU data . @return A object with a string property ` charset ` and a optional integer property ` q ` .
function decodeAcceptCharsetGeneralForm(data) {
    let length = ValueLength.decode(data);
    let begin = data.offset;
    let end = begin + length;
    let result;
    try {
      result = WellKnownCharset.decode(data);
    } catch (e) {
      data.offset = begin;
      result = {charset: TokenText.decode(data)};
      if (data.offset < end) {
        result.q = QValue.decode(data);
      }
    }
    if (data.offset != end) {
      data.offset = end;
    }
    return result;
  }
function decodeAcceptCharsetGeneralForm ( data ) { let length = ValueLength . decode ( data ) ; let begin = data . offset ; let end = begin + length ; let result ; try { result = WellKnownCharset . decode ( data ) ; } catch ( e ) { data . offset = begin ; result = { charset : TokenText . decode ( data ) } ; if ( data . offset < end ) { result . q = QValue . decode ( data ) ; } } if ( data . offset != end ) { data . offset = end ; } return result ; }
@param data
        A wrapped object containing raw PDU data.
@param data A wrapped object containing raw PDU data .