note 93326 deleted from function.utf8-encode by danbrown
| From: | danbrown@php.net | Date: | Thu, 03 Sep 2009 17:38:53 +0000 |
| Subject: | note 93326 deleted from function.utf8-encode by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-160198@lists.php.net to get a copy of this message | ||
Note Submitter: poorman at has_no_email dot com
----
caveat:
there's a bug in the script by squeegee, below. he's mixing up $input and $instr in the
preg_match instructions:
-----------------
if(1==preg_match($nibble_good_chars,$input,$match)){
$char=$match[1];
$rest=$match[2];
$outstr.=$char;
}elseif(1==preg_match('@^(.)(.*)$@s',$input,$match)){
$char=$match[1];
$rest=$match[2];
$outstr.=$byte_map[$char];
}
==============
should correctly read
-----------------
if(1==preg_match($nibble_good_chars,$instr,$match)){
$char=$match[1];
$rest=$match[2];
$outstr.=$char;
}elseif(1==preg_match('@^(.)(.*)$@s',$instr,$match)){
$char=$match[1];
$rest=$match[2];
$outstr.=$byte_map[$char];
}
==============
editors: please edit in. thanx.