[PATCH] handling of non-latin GSM subset in opensmppbox

Nii Ako Ampa-Sowa <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi,

opensmppbox doesn't seem to handle the non-Latin subset of the GSM character
set very well. This affects the Euro sign as well as Greek characters.
Attached is a patch that switches from using the Latin1 conversion routine
to the UTF-8 version.

Nii
non-latin-gsm-subset.patch (application/octet-stream, 2.1 KB)
Index: gw/opensmppbox.c
===================================================================
--- gw/opensmppbox.c	(revision 60)
+++ gw/opensmppbox.c	(working copy)
@@ -951,7 +951,7 @@
          */
         if ((pdu->u.deliver_sm.data_coding & 0xF0) ||
             (!box->alt_charset && pdu->u.deliver_sm.data_coding == 0)) {
-            charset_latin1_to_gsm(pdu->u.deliver_sm.short_message);
+            charset_utf8_to_gsm(pdu->u.deliver_sm.short_message);
         }
         else if (pdu->u.deliver_sm.data_coding == 0 && box->alt_charset) {
             /*
@@ -1186,7 +1186,7 @@
                              octstr_get_cstr(box->alt_charset), "ISO-8859-1");
                 msg->sms.coding = DC_7BIT;
             } else { /* assume GSM 03.38 7-bit alphabet */
-                charset_gsm_to_latin1(msg->sms.msgdata);
+                charset_gsm_to_utf8(msg->sms.msgdata);
                 msg->sms.coding = DC_7BIT;
             }
             break;
@@ -1224,7 +1224,7 @@
                 msg->sms.coding = DC_8BIT;
             else if (msg->sms.coding == DC_7BIT || msg->sms.coding == DC_UNDEF) { /* assume GSM 7Bit , reencode */
                 msg->sms.coding = DC_7BIT;
-                charset_gsm_to_latin1(msg->sms.msgdata);
+                charset_gsm_to_utf8(msg->sms.msgdata);
             }
     }
     msg->sms.pid = pdu->u.submit_sm.protocol_id;
@@ -1372,7 +1372,7 @@
                              octstr_get_cstr(box->alt_charset), "ISO-8859-1");
                 msg->sms.coding = DC_7BIT;
             } else { /* assume GSM 03.38 7-bit alphabet */
-                charset_gsm_to_latin1(msg->sms.msgdata);
+                charset_gsm_to_utf8(msg->sms.msgdata);
                 msg->sms.coding = DC_7BIT;
             }
             break;
@@ -1410,7 +1410,7 @@
                 msg->sms.coding = DC_8BIT;
             else if (msg->sms.coding == DC_7BIT || msg->sms.coding == DC_UNDEF) { /* assume GSM 7Bit , reencode */
                 msg->sms.coding = DC_7BIT;
-                charset_gsm_to_latin1(msg->sms.msgdata);
+                charset_gsm_to_utf8(msg->sms.msgdata);
             }
     }
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.