Author |
Post |
|
#1 Sat Jan 15, 2011 10:06, 160 months ago.
|
Member
Registered: Jan 2011
Location: Saint-Petersburg, Russian Federation
|
Operating system name and version: Gnu\Linux Debian squeeze Version of smsd: Smsd v3.1.11 Smsd installed from: package repository Name and model of a modem / phone: Nokia 22 Interface: serial
Hello! I'm use as locale ru_RU.UTF-8. I set in config: decode_unicode_text = yes Lette, i use command "iconv -f UCS-2BE -t UTF /var/.../msg.sms" and see russian text. now, I have some messages with "Alphabet: ISO". What ISO it use?
|
|
#2 Mon Jan 17, 2011 18:53, 160 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
When smstools3 talks about ISO, it's ISO-8859-15. With your language it's better not to use decode_unicode_text option, because it is limited to Latin alphabets when ICONV library is not used. As your locale is UTF-8, you could try the option incoming_utf8 = yes. This setting has effect when SMS is received using the GSM alphabet. Without this option the text is stored using ISO character set which is internal default for smstools. A command iconv can be used as you have shown, but only a message body should be converted, not the whole file which still contains headers written in ISO. Check this topic: [answered] Accentuated character conversion. It contains an eventhandler (in post #2) which does the conversion when Unicode message is received. This should work perfectly with your language too.
|
|
#3 Tue Jan 18, 2011 05:12, 160 months ago.
|
Member
Registered: Jan 2011
Location: Saint-Petersburg, Russian Federation
Topic owner
|
You get very useful link, thank!
But i think, I lost text of messages in ISO I try "tail -n 1 ./GSM1.0F3DZo | iconv -f ISO-8859-15 -t UTF8", but it not convert.
|
|
#4 Tue Jan 18, 2011 11:05, 160 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
With incoming_utf8 = yes you do not need to do conversion by yourself.
When handling SMS file, the message body is not just the last line. It's all lines after the first blank line. Use sed -e '1,/^$/ d' < "$2" to get the message body.
|
|
#5 Tue Jan 18, 2011 12:37, 160 months ago.
|
Member
Registered: Jan 2011
Location: Saint-Petersburg, Russian Federation
Topic owner
|
Of course! all incoming sms save with Cyrillic as right, already.
I mean, sms income before with converting in ISO, I ,probably, can't repair.
|