[Top][All Lists]

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

Re: 3110 SMS data encoding [patch]

From: Pawel Kot
Subject: Re: 3110 SMS data encoding [patch]
Date: Mon, 2 Jun 2003 11:47:52 +0200 (CEST)

On Sun, 1 Jun 2003, Osma Suominen wrote:

> 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.

Okay. I hope to answer your previous email today.

> 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.

Well, the original plan was to store SMS data internally in unicode as it
seems to be a definitely better idea. Just noone did implement it yet.

mailto:address@hidden :: mailto:address@hidden :: Kernel Traffic po polsku

reply via email to

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