New storage format for SqlBox

A problem that many people encountered while using SqlBox was that it was tricky to cope with charsets and binary messages when a DB was involved.

There were many things that can go wrong when storing data as text on a DB, specially if it involves non-ascii characters.

To fix that, Stipe Tolj recently submitted a patch that modified SqlBox to url-encode the message before writing it to the DB, and url-decodes it when reading from it.

That fixed the issue with special characters, but when you need to send binary messages you also need to deal with the udh field, which can be even more problematic (try writing a binary zero and you’ll know what I mean 😉 ).

To fix that, I’ve extended his patch to url-encode/decode the udhdata column as well. With this two fixes you shouldn’t have any issues sending special characters, wap-push and other binary messages either.

Both patches are now part of SqlBox and you’ll get them if you download the latest snapshot, or the SVN head.

IMPORTANT NOTE: If you’re relying on inserting messages on the “send_sms” table, you might need to change your code to url-encode the messages first.

Regards,

Alex