gnokii-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

question about encoding sequance


From: yueyue papa
Subject: question about encoding sequance
Date: Tue, 3 Jun 2008 16:57:21 +0800

Hi All,


Is there spec related how the unicode is encode in SMS, using big
indian or litle indian, or the indian flag in the SMS ?  After I
changed the wc encode sequance, the iconv works fine. Is this the
encode problem or my problem for how to call iconv. I am in windows
platform and use win_iconv as the code page convert tool.

/* null terminates the string */
unsigned int char_unicode_decode(unsigned char* dest, const unsigned
char* src, int len)
{
        int i, length = 0, pos = 0;
        MBSTATE mbs;

        MBSTATE_DEC_CLEAR(mbs);
        for (i = 0; i < len / 2; i++) {
#if 0
                wchar_t wc = src[i * 2] << 8 | src[(i * 2) + 1];   //original 
code
#else
                wchar_t wc = src[i * 2]  | src[(i * 2) + 1] << 8;  //I changed 
code
#endif
                length = char_uni_alphabet_decode(wc, dest, &mbs);
                dest += length;
                pos += length;
        }
        *dest = 0;
        return pos;
}


Lee




reply via email to

[Prev in Thread] Current Thread [Next in Thread]