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 :)
-- 
Enver ALTIN                   |        http://skyblue.gen.tr/
Software developer @ Parkyeri |      http://www.parkyeri.com/

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to