Просмотр файла onlineservice/online/unicode.lib.php

Размер файла: 326B
<?php
  // библиотека перекодировки текста
  function unicode ($s) { if ( (ord($s)>=192) & (ord($s)<=255) ) $hexvalue=dechex(ord($s)+848); if ($s=="Ё") $hexvalue="401"; if ($s=="ё") $hexvalue="451"; return("&#x0".$hexvalue.";");} 
  function utf_encode ($s) { return(preg_replace("/[А-яЁё]/e","unicode('\\0')",$s));} 
?>