note 82589 added to function.utf8-encode

From: Date: Thu, 17 Apr 2008 14:56:42 +0000
Subject: note 82589 added to function.utf8-encode
Groups: php.notes 
Request: Send a blank email to php-notes+get-138410@lists.php.net to get a copy of this message
that isUTF8 function is a killer... wouldn't something like if ( preg_match( "~(\x00[\x80-\xff]|[\x00-\x07][\x00-\xff]~", $string ) ) { /* is utf */ }; be a lot more efficient? it doesn't take into account all the ranges, but it has to be a better method and a simple start since it'll quit on the first successful match. think of encoding and decoding a 1mb string--not good. i'm having to work with +20 meg xml files. ---- Server IP: 208.69.120.35 Probable Submitter: 204.254.118.4 ---- Manual Page -- http://www.php.net/manual/en/function.utf8-encode.php Edit -- https://master.php.net/note/edit/82589 Del: integrated -- https://master.php.net/note/delete/82589/integrated Del: useless -- https://master.php.net/note/delete/82589/useless Del: bad code -- https://master.php.net/note/delete/82589/bad+code Del: spam -- https://master.php.net/note/delete/82589/spam Del: non-english -- https://master.php.net/note/delete/82589/non-english Del: in docs -- https://master.php.net/note/delete/82589/in+docs Del: other reasons-- https://master.php.net/note/delete/82589 Reject -- https://master.php.net/note/reject/82589 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#138410) next »