全部文本 #31794 原始 编辑

Stuff

公开 text v1 · 不可变
·已发布 2005-11-30 10:18 UTC
渲染后的文本正文
function iso2utf8($s)
/* Convert chars repr. by 1 or 2 bytes in utf8 */
{           
  $t="";
  $n=strlen($s);
  for ($i=0;$i<$n;$i++) {
    $c=ord($s[$i]);
    if ($c>127) {
      $t.=chr(192|($c/64)).chr(128|$c&63);
    } else {
      $t.=$s[$i];
    }   
  }     
  return $t;
}