SMS Server Tools 3
This site is hosted by Kekekasvi.com
 Menu
Basic information:
Additional information:
Support:
Get SMS Server Tools 3:
Additional Options

 Sponsored links

 Search
Custom Search

 Visitor locations
 
 SMS Server Tools 3 Community
Welcome, Guest. Please login or register. Fri Apr 19, 2024 03:06
SMSTools3 Community » Help and support Bottom

[solved] receving sms - UTF-8 files created in INCOMING folder

  This topic is locked

Page:  1

Author Post
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..

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.

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

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.

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.

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?

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.

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_eventhandler

and 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


Member
Registered:
May 2009
Topic owner
Hi,

Thank You for the fix.

I used another method to solve (via conversion program).

Thanks again...

  This topic is locked

Page:  1

SMSTools3 Community » Help and support Top

 
Time in this board is UTC.  

Privacy Policy   SMS Server Tools 3 Copyright © Keijo Kasvi.