About Unicode
UCS-2 is old encoding standard. It uses fixed size per encoded character and therefore is not compatible with ASCII.
UTF-8 is newer standard. It uses dynamic size between 8 – 32 bits per encoded character and is compatible with ASCII.
Я так понял что UCS-2 ещё называют UNICODE т.к. каждый символ это полные 2 байта тогда как UTF-8 называют просто UTF-8 изза того что размер используемых байтов меняется динамически взависимости от кодируемого символа.
But UCS-2 is used when sending SMS text message to mobile network, so if for single English SMS message 140 chars are used, for single Russian SMS message it is 70.
If you want to send web text as SMS to mobile phone do convert from UTF-8 to UCS-2 and then send.
For example, text here is stored in UTF-8 so I have to first convert it to UNICODE and then convert to URLencoded format. Then to send it via kannel we use charset=UCS-2
$in_msg = "проверим-ка-кодировку"; print urlencode(iconv('utf-8', 'ucs-2', $in_msg)); |