gnokii-users
[Top][All Lists]
Advanced

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

Re: 3110 SMS data encoding [patch]


From: Osma Suominen
Subject: Re: 3110 SMS data encoding [patch]
Date: Sun, 1 Jun 2003 18:10:23 +0300 (EEST)

On Sat, 31 May 2003, Pawel Kot wrote:

> > I think an even better place for this is the driver specific parameters
> > i.e. the gn_phone data structure, since this is really not phone
> > specific but phone family (eg 3110/3810/8110/8110i) specific.
>
> I think it is not true for phones handled by AT driver.

Okay. So let's make it a phone model specific flag then.

> Well, I think that adding an extra parameter is not a problem since these
> functions are not in API. And I don't think that such marker in the
> gn_sms_raw would be an elegant solution.
>
> This information does not come along with sms reeceived or being sent,
> but this it the driver (or rather phone) specific thing. So, let's not
> make a mess in the sms structs.

If you say so; let's do it with extra parameters then.

I haven't yet started writing code for this because I found several
problems when I investigated the current code (see my recent mail on
charsets). I think those issues should be fixed before this work is
relevant. Or at least I have to know how they are going to be fixed.

Actually I have a suggestion. Let's make it so that when gnokii is fed
input (SMS data), it respects locale, and first tries to convert the
input into Latin1. If this succeeds (there are no non-Latin1 chars),
then it is checked whether all Latin1 characters also exist in the
Default Alphabet. If they do, then the SMS charset is set to Default
Alphabet, and the data is internally stored as Latin1 text in the gn_sms
structure, and in either 7bit packed or Latin1 text in the gn_sms_raw
data structure, according to what the driver/phone wants. (If conversion
to Latin1 fails or there are non-DefaultAlphabet chars in the result,
send as UCS2 instead. This is already handled well enough, I think)

Conversion from locale-specific charset to Latin1 should be easy because
the lowest 256 chars in Unicode correspond to Latin1. So we can call
mbtowc() on the input, and if the resulting wide characters have their
most significant byte set to 0, then the conversion succeeded. There
might be easier ways still, but this seems pretty easy to me.

If you think this is a good plan (i.e.: state it explicitly that SMS
data is internally stored as Latin1, and make it so) I will start
writing code to do this.

But I'm also working on the statemachine and I have a suggestion for a
change that I will post soon. (And I have rewritten the fbus-3110 code,
but the new one needs changes in statemachine and nk3110.c as well,
which is not completed yet.)

> > Note that ASCII is not really a good name for what we're talking about,
>
> Oh well, it was just an example ;-)

Yeah, just trying to nitp...be specific :)

-Osma

-- 
*** Osma Suominen *** address@hidden *** http://www.iki.fi/ozone/ ***




reply via email to

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