X-Git-Url: https://git.jankratochvil.net/?p=gnokii.git;a=blobdiff_plain;f=common%2Fgsm-encoding.c;fp=common%2Fgsm-encoding.c;h=7408b27eb62ef774bd2b763910f564c72ff9ab88;hp=b539505ac4a802bacd6b88b9de4ab1324f55051a;hb=1379b6d01c3c3bd082a8ab32433450d8a2f3419c;hpb=a363234939c6030f24d092e9d4d97ee40f50ce03 diff --git a/common/gsm-encoding.c b/common/gsm-encoding.c index b539505..7408b27 100644 --- a/common/gsm-encoding.c +++ b/common/gsm-encoding.c @@ -13,14 +13,8 @@ Functions for encoding SMS, calendar and other things. $Log$ - Revision 1.1.1.1 2001/11/25 21:59:06 short - :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001 - - Revision 1.4 2001/11/22 17:56:53 pkot - smslib update. sms sending - - Revision 1.3 2001/11/17 20:15:31 pkot - Typo in default alphabet + Revision 1.1.1.2 2002/04/03 00:08:03 short + Found in "gnokii-working" directory, some November-patches version Revision 1.2 2001/11/08 16:34:19 pkot Updates to work with new libsms @@ -32,6 +26,7 @@ */ #include +#include #define NUMBER_OF_7_BIT_ALPHABET_ELEMENTS 128 @@ -55,7 +50,7 @@ static unsigned char GSM_DefaultAlphabet[NUMBER_OF_7_BIT_ALPHABET_ELEMENTS] = { 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 0xc4, 0xd6, 0xd1, 0xdc, 0xa7, 0xbf, 'a', 'b', 'c', 'd', 'e', 'f', 'g', - 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'H', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 0xe4, 0xf6, 0xf1, 0xfc, 0xe0 }; @@ -155,6 +150,7 @@ int Pack7BitCharacters(int offset, unsigned char *input, unsigned char *output) while ((IN - input) < strlen(input)) { unsigned char Byte = EncodeWithDefaultAlphabet(*IN); + *OUT = Byte >> (7 - Bits); /* If we don't write at 0th bit of the octet, we should write a second part of the previous octet */