js/sms_message_analyser.js
/** 
 * Encode message according to the "ISO-8859-1" alphabet.
 * The function is being initialized with the "message" input by the user.
 * The function returns:
 * - the message in its "encoded" (hex) "PDU" representation,
 * - the charset used,
 * - the number of "encoded" message characters,
 * - the number of "hex" characters that represent the "encoded" message text.
 * Note: function is not used in the application version: 1.0
 */
Encode message according to the "ISO-8859-1" alphabet.
The function is being initialized with the "message" input by the user.
Encode message according to the " ISO - 8859 - 1 " alphabet . The function is being initialized with the " message " input by the user .
function encode_ISO_8859_1(msg) {
  if (msg === null) {
    return null;
  }
  var pdu = [];
  for (i = 0; i < msg.length; i++) {
    pdu.push(ToHex(msg.charCodeAt(i)));
  }
  return {
    pdu: pdu.join(''),
    pdu_characters: pdu.length,
    pdu_hex_characters: pdu.length * 2,
    pdu_encoding: "ISO-8859-1"
  };
}
function encode_ISO_8859_1 ( msg ) { if ( msg === null ) { return null ; } var pdu = [ ] ; for ( i = 0 ; i < msg . length ; i ++ ) { pdu . push ( ToHex ( msg . charCodeAt ( i ) ) ) ; } return { pdu : pdu . join ( '' ) , pdu_characters : pdu . length , pdu_hex_characters : pdu . length * 2 , pdu_encoding : "ISO-8859-1" } ; }
Encode message according to the "ISO-8859-1" alphabet.
Encode message according to the " ISO - 8859 - 1 " alphabet .
/** Input message null; exit immediately. */ /** Initialize "PDU" array. Each array position will hold a character, in "hex" format, encoded according to the "ISO-8859-1" alphabet. */ /** 
   * Loop through all message characters, getting the (decimal) "code" of the char at the current index in this string, "converting" the 
   * this decimal "code" to its "hex" form and finally pushing "hex" value into the "PDU" array. 
   */ /** Return an "object" consisting of: */ /** the message in its "encoded" (hex) "PDU" representation. */ /** the number of "encoded" message characters. */ /** 
	 * the number of "hex" characters that represent the "encoded" message text; one "encoded" char is 
	 * represented by one "hex" number (two "hex" chars). 
	 */ /** the charset used; "ISO-8859-1" by default of course. */