Re: [PATCH] recode fix
Bruno Rodrigues <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
If recode is sucessful but there's entities inside, first if fails and
second if tries to recode again.
I've fixed it correctly and will commit in some minutes.
Thanks for noticing this
Rogelio M.Serrano Jr. wrote:
> 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>
>
>
> ------------------------------------------------------------------------
>
> --- 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.