Re: [RFI] octstr_recode

"Bruno David Rodrigues" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <016e01c1c47e$add69850$6e01290a@hobbes>
Re: [RFI] octstr_recodeIf the message is really not iso-8859-1, yes, we have to process the ucs2 (or utf8) externally.

But iso-8859-1 is differente from gsm_alphabet.

My ericsson T68 sends the message in unicode if I insert one accenter char.

Imagine that I have a service with a keywork test

If I send "test hello ããã hello", ericsson sends in unicode and kannel couldn't understand that
it's the test service and the "hello ããã hello" text.

With my patch, kannel understands and it works smoothly...

  ----- Original Message ----- 
  From: Andreas Fink 
  To: Bruno David Rodrigues 
  Cc: [email protected] 
  Sent: Tuesday, March 05, 2002 7:38 PM
  Subject: Re: [RFI] octstr_recode



    I'm trying to use the octstr_recode function to convert a MO message from UCS2 to
    ISO-8859-1 or UTF-8

    I was thinking in trying to recode to ISO-8859-1 if possible, otherwise convert to UTF-8
    and set coding acordly.

    I thought that if the text couldn't be translated to ISO-8859,
    octstr_recode (octstr_imm("iso-8859-1"), octstr_imm("UTF-16BE"), text)) would
    return false and I could switch to
    octstr_recode (octstr_imm("utf-8"), octstr_imm("UTF-16BE"), text)

    but the first recode converts my %06%4A to a &#1610; and returns ok.

    2002-03-05 18:04:51 [6] INFO: DAVI:Received message with coding 3
    2002-03-05 18:04:51 [6] INFO: DAVI:Received unicode message -J-064A-
    2002-03-05 18:04:51 [6] INFO: DAVI: recode to iso8859-1 -&#1610;-2623313631303B-
    2002-03-05 18:04:51 [6] INFO: Starting to service <&#1610;> from <my-number> to <short-number>
    2002-03-05 18:04:51 [6] DEBUG: formatted text answer: <Go away>
    2002-03-05 18:04:51 [6] DEBUG: message length 7, sending 1 messages

    May I search for &#xxxx; in utf16-be to iso8859-1 and reject it, switching then to utf8 ??


  I understand your goal. Support incoming Unicode.
  Well the question is do we need to recode in this case?
  If the incoming message is in unicode, its most probably not readable by us (being iso8859-1 only humans)). So why not simply carry them along "as is". the coding in DCS from the incoming message tells us its unicode, and thats enough for us.


  The only thing I see a problem with is SMSbox'es keywords where it would have to split off a keyword (ok that can be done) but then we need to enter non english keywords in a ascii textfile which gets tough....


-- 


  Andreas Fink
  Fink-Consulting

  ------------------------------------------------------------------
  Tel: +41-61-6932730 Fax: +41-61-6932729  Mobile: +41-79-2457333
  Address: A. Fink, Schwarzwaldallee 16, 4058 Basel, Switzerland
  E-Mail:  [email protected]  Homepage: http://www.finkconsulting.com
  ------------------------------------------------------------------
  Something urgent? Try http://www.smsrelay.com/  Nickname afink
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.