[PATCH] recode fix

Rogelio M.Serrano Jr. <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <101a260c6a922620d59dab3ff7201fa1@master>
Hi All,

This is a quick and dirty fix. All UTF16-BE messages i was receiving 
can not be converted to latin 1 anyway. I think its some buffer that 
needs to be reset before trying to recode to utf-8.


<recode_fix.diff>
recode_fix.diff (text/plain, 1012 B)
--- gateway-1.3.2.orig/gw/smsbox.c	2004-08-05 21:07:26.000000000 +0800
+++ gateway-1.3.2/gw/smsbox.c	2004-08-05 21:09:07.000000000 +0800
@@ -1566,6 +1566,7 @@
 	    Octstr *text;
 	    text = octstr_duplicate(msg->sms.msgdata);
 
+/*
 	    if(0 == octstr_recode (octstr_imm("iso-8859-1"), octstr_imm("UTF-16BE"), text) &&
                octstr_search(text, octstr_imm("&#"), 0) == -1) {
                 /* XXX I'm trying to search for &#xxxx; text, which indicates that the
@@ -1578,7 +1579,9 @@
                 msg->sms.charset = octstr_create("ISO-8859-1");
                 msg->sms.coding = DC_7BIT;
 	    }
-	    else if(0 == octstr_recode (octstr_imm("UTF-8"), octstr_imm("UTF-16BE"), text) &&
+	    else 
+*/
+               if(0 == octstr_recode (octstr_imm("UTF-8"), octstr_imm("UTF-16BE"), text) &&
                octstr_search(text, octstr_imm("&#"), 0) == -1) {
                 /* XXX I'm trying to search for &#xxxx; text, which indicates that the
                  * text couldn't be recoded.
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.