note 80832 added to function.mb-regex-encoding

From: Date: Sat, 02 Feb 2008 14:30:13 +0000
Subject: note 80832 added to function.mb-regex-encoding
Groups: php.notes 
Request: Send a blank email to php-notes+get-135732@lists.php.net to get a copy of this message
Note, that the regex encoding is only set to the initial internal character encoding. If you change the internal encoding in your script with mb_internal_encoding() the regex encoding does not change. For example: <?php echo "current mb_internal_encoding: ".mb_internal_encoding()."<br />"; echo "current mb_regex_encoding: ".mb_regex_encoding()."<br />"; echo "changing mb_internal_encoding to UTF-8<br />"; mb_internal_encoding("UTF-8"); echo "new mb_internal_encoding: ".mb_internal_encoding()."<br />"; echo "new mb_regex_encoding: ".mb_regex_encoding()."<br />"; ?> This code might output (depending on your initial internal character encoding): current mb_internal_encoding: ISO-8859-1 current mb_regex_encoding: ISO-8859-1 changing mb_internal_encoding to UTF-8 new mb_internal_encoding: UTF-8 new mb_regex_encoding: ISO-8859-1 Furthermore the sentence "The default value is the internal character encoding." in the documentation might be misleading because the initial default value of the regex encoding is meant, and not the default value for the optional encoding parameter. ---- Server IP: 217.13.201.10 Probable Submitter: 78.42.67.14 ---- Manual Page -- http://www.php.net/manual/en/function.mb-regex-encoding.php Edit -- https://master.php.net/note/edit/80832 Del: integrated -- https://master.php.net/note/delete/80832/integrated Del: useless -- https://master.php.net/note/delete/80832/useless Del: bad code -- https://master.php.net/note/delete/80832/bad+code Del: spam -- https://master.php.net/note/delete/80832/spam Del: non-english -- https://master.php.net/note/delete/80832/non-english Del: in docs -- https://master.php.net/note/delete/80832/in+docs Del: other reasons-- https://master.php.net/note/delete/80832 Reject -- https://master.php.net/note/reject/80832 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#135732) next »