Author |
Post |
|
#1 Tue May 19, 2009 09:19, 181 months ago.
|
Member
Registered: May 2009
|
When receiving an SMS that used hebrew characters the file that is created in the INCOMING folder are UTF-8 format. This file is not readable and cannot be processed
My questions: 1. Can the file format be defined in a parameter within 'sms server tools' 2. under Linux, how this file can be converted to ascii to ISO files, so it can readable by gedit editor.
Thanks..
|
|
#2 Tue May 19, 2009 10:03, 181 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
I assume that your message is pure Unicode. There are some options, but I have to know what version of smsd you are using? Also, what is the locale of your system?
It might be useful to see smsd.conf content too.
|
|
#3 Tue May 19, 2009 10:17, 181 months ago.
|
Member
Registered: May 2009
Topic owner
|
Hi, I am using smstools3-3.1.3
The sms that is sent contain only digits. However, the SMS file that is created in the INCOMING folder is format is utf-8.
The question is if we can inforce the creation of a text file in the INCOMING folder.
What do you mean by local? Also, which is the parameter in the smsd.conf that might help?
Thanks
|
|
#4 Tue May 19, 2009 10:43, 181 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
I meant locale, like: root@pro2:/usr/local/src/smstools3/src# locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" etc...
There are two important settings: decode_unicode_text which defaults to no and incoming_utf8 which also defaults to no.
If received message is using Unicode, it's body is saved as it is. Messages with GSM alphabet are stored using ISO character set. Headers are always stored using ISO. If a system is using UTF-8 as a locale, like mine, incoming_utf8 should be set to yes.
If you have PDU string from the logfile available, show it to me, I can check what it actually contains. You can use Private tags to hide PDU from other board members.
|
|
#5 Tue May 19, 2009 11:05, 181 months ago.
|
Member
Registered: May 2009
Topic owner
|
Hi,
The following is my locale
LANG="en_US.UTF-8" LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MESUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=
How I can define that the header and SMS itself will be also in ISO.
Can you please tell me the exact command to that should modify this (in locale or maybee elsewhere)
Thanks.
|
|
#6 Tue May 19, 2009 11:21, 181 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
You do not have the PDU string from logfile available?
Headers in message files are always ISO and it's the same as UTF-8 because headers are in english.
There is a header Alphabet: included in each message file. What value is it saying in the message which contains hebrew characters, and in the message which was sent containing only digits?
|
|
#7 Tue May 19, 2009 11:37, 181 months ago.
|
Member
Registered: May 2009
Topic owner
|
Hi,
The header: Alphabet: UCS2
The PDU string is AT+CMGF=0
If this is not the PDU string, please let me know how to extract.
Thanks.
|
|
#8 Tue May 19, 2009 16:09, 181 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Ok, you are receiving Unicode message and you need to change it to UTF-8, not ISO. Set up an eventhandler, smsd.conf: eventhandler = /usr/local/bin/smsd_eventhandlerand the file: #!/bin/bash
if [ "$1" = "RECEIVED" ]; then
alphabet=`formail -zx Alphabet: < $2` if [ "x$alphabet" = "xUCS2" ]; then TMPFILE=`mktemp /tmp/smsd_XXXXXX` sed -e '/^$/ q' < $2 | formail -f -I "Alphabet: UTF-8" > $TMPFILE sed -e '1,/^$/ d' < $2 | iconv -f UNICODEBIG -t UTF-8 >> $TMPFILE mv $TMPFILE $2 fi
fi 'bash' Syntax Highlight powered by GeSHi
|
|
#9 Wed May 20, 2009 16:37, 181 months ago.
|
Member
Registered: May 2009
Topic owner
|
Hi,
Thank You for the fix.
I used another method to solve (via conversion program).
Thanks again...
|