note 49562 added to function.htmlentities

From: Date: Tue, 01 Feb 2005 17:40:19 +0000
Subject: note 49562 added to function.htmlentities
Groups: php.notes 
Request: Send a blank email to php-notes+get-84338@lists.php.net to get a copy of this message
This is a followup to the older note by mirrorball_girl (5 Jan 2003) for those who may follow. Rather than making an exception for the en-dash (#150) and translating it to a hyphen, you could use the – unicode en-dash entity (assuming that you are serving up your pages as UTF-8 or some such encoding. Also, the whole thing can be done better with mb_detect_order, mb_detect_encoding and mb_convert_encoding if all you want to do is serve up a web page (if you need to convert to pure ASCII, that's another issue). You need to have multi-byte support enabled on your PHP server. Basically, the problem is with older MS programs that use Windows-1252 for their encoding, so all you really need to do is - detect for Win-1252 - if present, convert to UTF-8 - serve up your pages as UTF-8 See the manual on Multibyte String Functions for more information. ---- Manual Page -- http://www.php.net/manual/en/function.htmlentities.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+49562 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49562&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49562&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49562&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49562&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49562&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+49562&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#84338) next »