UTF-8 to UCS-2 SMS


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function sms__unicode($message) {
  2. if (function_exists('iconv')) {
  3. $latin = @iconv('UTF-8', 'ISO-8859-1', $message);
  4. if (strcmp($latin, $message)) {
  5. $arr = unpack('H*hex', @iconv('UTF-8', 'UCS-2BE', $message));
  6. return strtoupper($arr['hex']) .'&unicode=1';
  7. }
  8. }
  9. return FALSE;
  10. }

URL: http://www.eggheadcafe.com/community/aspnet/79/10132316/utf8-to-ucs2.aspx

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.