--- smsdaemon/SmsPdu.cpp 2008/06/13 08:37:19 72 +++ smsdaemon/SmsPdu.cpp 2008/06/13 09:09:36 73 @@ -36,6 +36,9 @@ string EncodePhonenr(string input) { + if ( input.at(0) == '+' ) + input.erase(0,1); + if ( (input.length() % 2) == 1) input.append("F"); return SwitchChars(input); @@ -78,7 +81,7 @@ return vec; } - std::string Decode8to7bit(vector input, int shift_start = 0) + std::string Decode8to7bit(vector input, int shift_start) { string result; @@ -110,11 +113,11 @@ - vector Encode7to8bit(std::string str) + vector Encode7to8bit(std::string str, int shift_start) { vector buf; - int shift = 0; + int shift = shift_start; for (unsigned int i=0; i phone = HexDecodeString( EncodePhonenr(to )); pdu.insert( pdu.end(), phone.begin(), phone.end()); pdu.push_back(0x00); // Protocol identifier pdu.push_back(0x00); // Data coding scheme + int shift_start = 0; string message_part; if (multipart) { @@ -199,7 +203,7 @@ pdu.push_back( part_count ); pdu.push_back( partnr+1 ); pdu.push_back( 0x00); - + //shift_start = 6; } else { @@ -216,7 +220,7 @@ pdu.push_back( message_part.length() ); //UserDataLength } - vector userData = Encode7to8bit(message_part); + vector userData = Encode7to8bit(message_part, shift_start); pdu.insert( pdu.end(), userData.begin(), userData.end());