[RFI] octstr_recode

"Bruno David Rodrigues" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <00cc01c1c473$6a422f10$6e01290a@hobbes>
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 ??
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.