网上流传的一个编码程序如下: function EncodeSMSEn(s: String): String; var i, j, len: Integer; cur: Integer; t: String; begin Result := ''; len := Length(s); //j 用于移位计数 i := 1; j := 0; while i <= len do begin if i < len then //数据变换 cur := (Ord(s[i]) shr j) or ((Ord(s[i+1]) shl (7 - j)) and $ff) else cur := (Ord(s[i]) shr j) and $7f; FmtStr(t, '%2.2X', [cur]); Result := Result+t; inc(i); //移位计数达到7位的特别处理 j := (j+1) mod 7; if j = 0 then inc(i); end; end; 但是这个程序有问题, 在英文字符个数大于7后就不适用 例如发送congradulations! u r superman!@##$%^&*())_@! AT+CMGS=52 > 0011000B81************30000FF2680F1DB7D9687C97576989E7EBBE721501D2407CDEBF0B2BC1D768780A311A9E435A950A9D417
ERROR

|