note 93326 added to function.utf8-encode
| From: | poorman at has_no_email dot com | Date: | Thu, 03 Sep 2009 10:35:51 +0000 |
| Subject: | note 93326 added to function.utf8-encode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-160187@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 194.153.94.10
Probable Submitter: 84.74.75.36
----
Manual Page -- http://www.php.net/manual/en/function.utf8-encode.php
Edit -- https://master.php.net/note/edit/93326
Del: integrated -- https://master.php.net/note/delete/93326/integrated
Del: useless -- https://master.php.net/note/delete/93326/useless
Del: bad code -- https://master.php.net/note/delete/93326/bad+code
Del: spam -- https://master.php.net/note/delete/93326/spam
Del: non-english -- https://master.php.net/note/delete/93326/non-english
Del: in docs -- https://master.php.net/note/delete/93326/in+docs
Del: other reasons-- https://master.php.net/note/delete/93326
Reject -- https://master.php.net/note/reject/93326
Search -- https://master.php.net/manage/user-notes.php