Re: Coding autodetection

Enver ALTIN <[email protected]>
Newsgroups gmane.comp.mobile.kannel.user,gmane.comp.mobile.kannel.devel
Organization Parkyeri
Message-ID <[email protected]>
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/
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQBB9lYBZCB2FZvqK0sRAk05AJ99kQlOCu+0mHXFBkecQDJLJYs6ZgCfXpzW
HOGONppH+VxOB7G4K4oxoMI=
=5lc2
-----END PGP SIGNATURE-----
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.