Re: Coding autodetection
Stipe Tolj <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel,gmane.comp.mobile.kannel.user |
|---|---|
| Organization | The Kannel Group |
| Message-ID | <[email protected]> |
Hi Enver,
Enver ALTIN wrote:
> Hi,
>
> On Tue, 2005-01-25 at 15:32 +0300, Roman wrote:
>
>>I have kannel 1.4.0 and some scripts, which used in exec
>>statement in kannel.conf service section. These scripts can return
>>result in UCS2 or GSM coding(english or another language).
>>Is there way in kannel(without patching it) to autodetect coding and
>>set it in PDU. Or may be there are some params to set coding type for exec
>>results?
>
>
> I have implemented this on my application like this:
>
> * I try to convert (always UTF-8) input text to US-ASCII coding,
> if it succeeds, it's at most 8bit.
> * A loop checks every byte in converted text to be in
> 32..127 range. If every byte is in this range, message
> is safe to send in 7bit coding.
> * If US-ASCII conversion fails, I convert the message to UCS2 and
> send it with 16bit coding.
>
> This worked fairly well for me. I think we can implement coding
> autodetection in Kannel this way. The problem is, client needs to know
> how many messages did the content get split into, when concatenation is
> enabled for sendsms-user :)
sounds reasonable. Patches in 'diff -u' format are welcome ;)
Stipe
mailto:stolj_{at}_wapme.de
-------------------------------------------------------------------
Wapme Systems AG
Vogelsanger Weg 80
40470 Düsseldorf, NRW, Germany
phone: +49.211.74845.0
fax: +49.211.74845.299
mailto:info_{at}_wapme-systems.de
http://www.wapme-systems.de/
-------------------------------------------------------------------