Author |
Post |
|
#1 Tue Aug 27, 2013 06:46, 128 months ago.
|
Member
Registered: Mar 2011
Location: Russian Federation
|
Sent messages are stored in specified folder but text part of the messages are encoded to UNICODEBIG. I would like to save text of the message in UTF-8 for reading in mc. Also I need to keep readable sms headers (To, Alphabet, Modem, e.t.c.)
How to do this ?
Is any way to do 'iconv -f UNICODEBIG -t UTF-8' to text of the messages ?
|
|
#2 Sun Sep 01, 2013 19:11, 128 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
The following script might work as an eventhandler. Take it as example, I have not tested it, just found some code and made minor modifications.. #!/bin/bash
if [ "$1" == "SENT" ]; then
if sed -e '/^$/ q' < "$2" | grep "^Alphabet: UCS2" > /dev/null; then TMPFILE=`mktemp /tmp/smsd_XXXXXX` sed -e '/^$/ q' < "$2" | sed -e 's/Alphabet: UCS2/Alphabet: UTF-8/g' > $TMPFILE sed -e '1,/^$/ d' < "$2" | iconv -f UNICODEBIG -t UTF-8 >> $TMPFILE mv $TMPFILE "$2" fi
fi 'bash' Syntax Highlight powered by GeSHi
|
|
#3 Mon Sep 02, 2013 02:34, 128 months ago.
|
Member
Registered: Mar 2011
Location: Russian Federation
Topic owner
|
keke wrote The following script might work as an eventhandler. Take it as example, I have not tested it, just found some code and made minor modifications..
Thanks. Seems works.
|