note 62131 added to function.htmlentities

From: Date: Tue, 21 Feb 2006 00:54:52 +0000
Subject: note 62131 added to function.htmlentities
Groups: php.notes 
Request: Send a blank email to php-notes+get-104094@lists.php.net to get a copy of this message
many people below talk about using <?php mb_convert_encode($s,'HTML-ENTITIES','UTF-8'); ?> to convert non-ascii code into html-readable stuff. Due to my webserver being out of my control, I was unable to set the database character set, and whenever PHP made a copy of my $s variable that it had pulled out of the database, it would convert it to nasty latin1 automatically and not leave it in it's beautiful UTF-8 glory. So [insert korean characters here] turned into ?????. I found myself needing to pass by reference (which of course is deprecated/nonexistent in recent versions of PHP) so instead of <?php mb_convert_encode(&$s,'HTML-ENTITIES','UTF-8'); ?> which worked perfectly until I upgraded, so I had to use <?php call_user_func_array('mb_convert_encoding', array(&$s,'HTML-ENTITIES','UTF-8')); ?> Hope it helps someone else out ---- Server IP: 210.55.230.122 (proxied: 202.89.36.242 1.0 proxy2.akl1.maxnet.net.nz:8080 (Squid/2.4.STABLE2)) Probable Submitter: 203.97.10.134 ---- Manual Page -- http://www.php.net/manual/en/function.htmlentities.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+62131 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+62131&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+62131&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+62131&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+62131&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+62131&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+62131&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+62131&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+62131&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#104094) next »