Re: [RFI] octstr_recode

Andreas Fink <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <p05101407b8aace78c341@[10.0.0.2]>
>
>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.