make for me email header
Content-Type: text/plain; charset=UCS-2BE
It should do this, but is "UCS-2BE" really a
valid charset name? IMO you should use "UTF-16BE" instead ...
and gmail show correctly this header (in incoming mail)?
I don't know, if it will do so ... but here is the answer too: it should do this. It's the responsibility of the MUA to display the correct content.
i want process incoming SMS from USB mobile ( /var/gsm/ttyDATA )
I've researched this topic some month ago ...
If you want to use the USB modem only for SMS sending/receiving, it's possible ... yes.
But you've to prevent AVM's umtsd daemon from accessing the device or you have to implement something like a "serial port multiplexor" to regulate, which daemon is in control of the port.
To use the modem only for SMS processing, you can use a software called
smstools3. It's available as a
Freetz package too and you could build it standalone without the needs to use a complete Freetz image. Even if the linked pages from freetz.org are in German, there's not so much information, that you can't understand its content I hope ... and the smstools3 web site is in English.
The german page regarding smstools3 says, that you should remove the original umtsd daemon from the firmware image (it's the record after the "attention" icon), but you can carry it on ... if you modify the start script for the smstools3 daemon and stop the umtsd process, before you start another process accessing the modem devices. And last, but not least, you should access the /var/gsm/CONTROL port better ... most modems are using this port to handle commands and send unsolicited answers/messages.
BTW: Why do you think about UCS2? Short messages arrive with
PDU encoding usually ... at least it's the mode, which nearly every modem understands. But smstools3 does the conversions for you ...