Re: [PATCH] fix sms_split in sms.c

Stipe Tolj <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization tolj.org system architecture
Message-ID <[email protected]>
Alexander Malysh wrote:

> Hi,
> 
> seems sms_split function was always buggy and never worked correctly?
> I found two issues:
> 
> 1) max_part_len calculation was wrong.
>     It was:
> max_len * 8 / 7 - udh_len
>     But because udh nerer packed this is just wrong end should be:
> (max_len - udh_len) * 8 / 7
> 
> 2) we dropped last utf-8 multibyte sequence. (Thanks to Stipe for report!).
>    To reproduce just sent following message via smsbox:
> text=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%c3%9f 
> 
> 
>    To fix the bug we must first convert msgdata to UTF-8 then 
> gsm_truncate  and then convert it again to UTF-8. The length of UTF-8 
> string is our  allowed max_part_length.
> 
> Please find attached patch that should fix those issues.
> Please test and vote!

thanks a lot Alex... I'll review thoughout the day tomorrow.

Since this has a serious impact, I'd suggest we apply it (if voted positive) to 
the 1.4.1 branch and release 1.4.2 from that seperated CVS branch immediately. 
So we have a fix for the "old" latin1 internal encoding.

Then release 1.5.0 devel with the new UTF-8 internal encoding and propagate it 
to stable after a while.

Stipe

-------------------------------------------------------------------
Kölner Landstrasse 419
40589 DÃŒsseldorf, NRW, Germany

tolj.org system architecture      Kannel Software Foundation (KSF)
http://www.tolj.org/              http://www.kannel.org/

mailto:st_{at}_tolj.org           mailto:stolj_{at}_kannel.org
-------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.