note 47987 added to function.convert-cyr-string

From: Date: Wed, 08 Dec 2004 09:05:00 +0000
Subject: note 47987 added to function.convert-cyr-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-81514@lists.php.net to get a copy of this message
He is improved function to decode win1251->UTF8 <?php function win2utf($s){ $c209 = chr(209); $c208 = chr(208); $c129 = chr(129); for($i=0; $i<strlen($s); $i++) { $c=ord($s[$i]); if ($c>=192 and $c<=239) $t.=$c208.chr($c-48); elseif ($c>239) $t.=$c209.chr($c-112); elseif ($c==184) $t.=$c209.$c209; elseif ($c==168) $t.=$c208.$c129; else $t.=$s[$i]; } return $t; } ?> ---- Manual Page -- http://www.php.net/manual/en/function.convert-cyr-string.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47987 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47987&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47987&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47987&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47987&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47987&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47987&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47987&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#81514) next »