X-Git-Url: https://git.jankratochvil.net/?p=gnokii.git;a=blobdiff_plain;f=common%2Fgsm-coding.c;fp=common%2Fgsm-coding.c;h=c9f0e1822394e138a94194c8e034cd049138dacc;hp=7baaaa929ad8d3422c6fe4b208251ec76f756b90;hb=31a7f67cc67fb86a4e4a225dd71ccf0030ea70e7;hpb=3937f2bb188eb23aab93a225ab859c04d6db1a4c diff --git a/common/gsm-coding.c b/common/gsm-coding.c index 7baaaa9..c9f0e18 100644 --- a/common/gsm-coding.c +++ b/common/gsm-coding.c @@ -15,10 +15,10 @@ #include "gsm-coding.h" #ifdef WIN32 - #include + #include #else #include "devices/device.h" -#endif +#endif /* Coding functions */ #define NUMBER_OF_7_BIT_ALPHABET_ELEMENTS 128 @@ -307,7 +307,7 @@ void EncodeUnicode (unsigned char* dest, const unsigned char* src, int len) bool EncodeWithUTF8Alphabet(u8 mychar, u8 *ret1, u8 *ret2) { u8 mychar1,mychar2,mychar3,mychar4; - int j=0; + int j=0; mychar1=((EncodeWithUnicodeAlphabet(mychar)>>8)&0xff); mychar2=EncodeWithUnicodeAlphabet(mychar)&0xff; @@ -317,9 +317,9 @@ bool EncodeWithUTF8Alphabet(u8 mychar, u8 *ret1, u8 *ret2) while (true) { if (mychar3==mychar1) { if (mychar4+64>=mychar2) { - *ret1=j+0xc2; - *ret2=0x80+(mychar2-mychar4); - return true; + *ret1=j+0xc2; + *ret2=0x80+(mychar2-mychar4); + return true; } } if (mychar4==192) { @@ -352,7 +352,7 @@ void DecodeWithUTF8Alphabet(u8 mychar3, u8 mychar4, u8 *ret) } mychar2=mychar2+(mychar4-0x80); wc = mychar2 | (mychar1 << 8); - *ret=DecodeWithUnicodeAlphabet(wc); + *ret=DecodeWithUnicodeAlphabet(wc); j=-1; }