[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: question about encoding sequance
From: |
yueyue papa |
Subject: |
Re: question about encoding sequance |
Date: |
Tue, 10 Jun 2008 10:42:47 +0800 |
> the correct encoding should be detected at runtime by
> gn_char_get_encoding() using get_langinfo_codeset()
> can you check what happens in these two functions?
==> this API is not what I wanted. The API is get the PC lanuguage
setting. PC language setting could be different from what SMS language
setting. eg: My PC is still set as english, but the SMS may be encoded
by "GB2312". Got the PC setting is no useful for decode SMS message.
So I am simple set the application_encoding type.
i remember in my PC: gn_char_get_encoding return "English_United
States.936", a long string.
gn_char_get_encoding(), did not return any acceptabel string for iconv_open.
So the iconv_open(gn_char_get_encoding(), "UTF16"); return NULL, the
NULL is not processed.
> > cd = iconv_open(gn_char_get_encoding(), "UTF16");
>
> the correct encoding is UCS-2 (I know they are nearly identical) and
> using UCS-2BE should make the following change to
> char_unicode_decode() unnecessary
==>
correctly. I chaned this encoding, there is no used to change byte sequance.
cd = iconv_open(gn_char_get_encoding(), "UTF-16LE");
It still back to my previous question: How could i known the
iconv_open "from" paramter. Is it preencoded in the SMS or
Application needs to know it first.
On 6/7/08, Daniele Forsi <address@hidden> wrote:
> 2008/6/6 yueyue papa wrote:
>
> > 5> Change code gsm-encoding.c
> > static char application_encoding[64] = "";
> > ==>
> > static char application_encoding[64] = "gb2312";
>
> the correct encoding should be detected at runtime by
> gn_char_get_encoding() using get_langinfo_codeset()
> can you check what happens in these two functions?
>
> > In function: static int char_wctomb(char *dst, wchar_t src, MBSTATE *mbs)
> >
> > cd = iconv_open(gn_char_get_encoding(), "WCHAR_T");
> > ==>
> > cd = iconv_open(gn_char_get_encoding(), "UTF16");
>
> the correct encoding is UCS-2 (I know they are nearly identical) and
> using UCS-2BE should make the following change to
> char_unicode_decode() unnecessary
>
> > In function: unsigned int char_unicode_decode(unsigned char* dest,
> > const unsigned char* src, int len)
> >
> > wchar_t wc = src[i * 2] << 8 | src[(i * 2) + 1];
> > ==>
> > wchar_t wc = src[i * 2] | (src[(i * 2) + 1] << 8 );
>
>
> > 4> phone book name display has not added UNICODE sequance.
>
> see http://wiki.gnokii.org/index.php/Bug_report
> --
> Daniele Forsi
>
>
> _______________________________________________
> gnokii-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/gnokii-users
>