Problems with charset
Andreas Fink
afink at list.fink.org
Wed Sep 5 08:00:01 CEST 2007
Try adding coding=1 to force 8 bit coding.
Important question: what is the value of HAVE_ICONV_H in your gw-
config.h
if its 0 you run into this in charset_convert()
/* no convertion done due to not having iconv */
return -1;
This is the routing causing it to fail.
by looking at charset_convert() I can see that if that part fails,
you would get additional error messages so the logical conclusion is
that you have a version without iconv compiled in? please verify
int charset_processing (Octstr *charset, Octstr *body, int coding) {
int resultcode = 0;
if (octstr_len(charset)) {
/* debug("sms.http", 0, "enter charset, coding=%d, msgdata is %s",
coding, octstr_get_cstr(body));
octstr_dump(body, 0); */
if (coding == DC_7BIT) {
/*
* For 7 bit, convert to WINDOWS-1252
*/
if (charset_convert(body, octstr_get_cstr(charset), "UTF-8")
< 0) {
resultcode = -1;
}
} else if (coding == DC_UCS2) {
/*
* For UCS-2, convert to UTF-16BE
*/
if (charset_convert(body, octstr_get_cstr(charset), "UTF-16BE")
< 0) {
resultcode = -1;
}
}
/* debug("sms.http", 0, "exit charset, coding=%d, msgdata is %s",
coding, octstr_get_cstr(body));
octstr_dump(body, 0); */
}
return resultcode;
}
On 03.09.2007, at 22:40, Stefan Cars wrote:
> Hi!
>
> For example this:
>
> http://xxxx:47102/cgi-bin/sendsms?
> username=stefan&password=xxx&from=72020&to=46708443600&text=hejsa%
> E5%E4%F6&charset=iso-8859-1
>
> bearbox does not log anything, this is what I get from smsbox log
>
> 2007-09-03 22:37:24 [95342] [2] DEBUG: HTTP: Creating HTTPClient
> for `83.226.133.188'.
> 2007-09-03 22:37:24 [95342] [2] DEBUG: HTTP: Created HTTPClient
> area 0x8136580.
> 2007-09-03 22:37:24 [95342] [3] INFO: smsbox: Got HTTP request </
> cgi-bin/sendsms> from <83.226.133.188>
> 2007-09-03 22:37:24 [95342] [3] INFO: sendsms used by <stefan>
> 2007-09-03 22:37:24 [95342] [3] INFO: sendsms sender:<stefan:72020>
> (83.226.133.188) to:<46708443600> msg:<hejsaåäö>
> 2007-09-03 22:37:24 [95342] [3] DEBUG: Status: 400 Answer: <Charset
> or body misformed, rejected>
> 2007-09-03 22:37:24 [95342] [3] DEBUG: HTTP: Resetting HTTPClient
> for `83.226.133.188'.
>
>
>
> On Mon, 3 Sep 2007, Alexander Malysh wrote:
>
>> Hi,
>>
>> could you please post your sendsms URL you used and smsbox +
>> bearerbox debug
>> logs?
>>
>> Stefan Cars wrote:
>>
>>> Hi!
>>>
>>> On another strange thing is that if I send in UTF-8 instead of ISO
>>> (without charset=) kannel.log says:
>>>
>>> Failed to convert msgdata from charset <ISO-8859-1> to
>>> <ISO-8859-1>, will
>>> send as is. And my handset does not receive the message...
>>>
>>> Kind Regards,
>>> stefan Cars
>>>
>>>
>>> On Sun, 2 Sep 2007, Andreas Fink wrote:
>>>
>>>> I think the correct writing would be to say charset=iso-8850-1
>>>> or you
>>>> simply
>>>> send it as UTF-8 which is lossless.
>>>>
>>>> On 02.09.2007, at 13:51, Stefan Cars wrote:
>>>>
>>>>> Hi!
>>>>>
>>>>> We have upgraded an old Kannel server to latest cvs and have some
>>>>> trouble handling charsets. As I understand, earlier ISO-8859-1
>>>>> was
>>>>> standard charset but now UTF-8 is standard.
>>>>>
>>>>> Our SMPP link has ISO-8859-1 as charset and this works well,
>>>>> alt-charset is set and smsbox delivers the SMSes correctly,
>>>>> although
>>>>> in the access_log since the upgrade the Swedish characters
>>>>> can't be
>>>>> viewed. (Shown has dots).
>>>>>
>>>>> More of a problem is the fact that we can't send through the CGI
>>>>> sendsms interface anymore, all swedish characters does get
>>>>> corrupted
>>>>> and adding charset=latin1 (as prosposed in a mail from alxeander
>>>>> malysh in a mail when he submitted the patch to convert) is not
>>>>> working, we get an error saying "Charset or body misformed,
>>>>> rejected".
>>>>> We can't convert all applications sending in ISO-8859-1 to send in
>>>>> UTF-8, it must be possible to send ISO-8859-1 to /sendsms ?
>>>>>
>>>>> Kind Regards,
>>>>> Stefan Cars
>>>>
>>>
>>> --
>>> Stefan Cars
>>> Snowfall Communications
>>> http://www.snowfall.se
>>> Tel: +46 (0)18 430 80 50 - Direct: +46 (0)18 430 80 51
>>> Mobile: +46 (0)708 44 36 00 - Fax: +46 (0)708 44 36 04
>>
>> --
>> Thanks,
>> Alex
>>
>>
>
> --
> Stefan Cars
> Snowfall Communications
> http://www.snowfall.se
> Tel: +46 (0)18 430 80 50 - Direct: +46 (0)18 430 80 51
> Mobile: +46 (0)708 44 36 00 - Fax: +46 (0)708 44 36 04
More information about the devel
mailing list