Req #34577 [Opn->Fbk]: get_html_translation_table is missing a lot of xHTML entities
Edit report at https://bugs.php.net/bug.php?id=34577&edit=1
ID: 34577
Updated by: cmb@php.net
Reported by: mark_meredith at shaw dot ca
Summary: get_html_translation_table is missing a lot of xHTML
entities
-Status: Open
+Status: Feedback
Type: Feature/Change Request
Package: Strings related
Operating System: Mac OS X 10.4.2
PHP Version: 5.0.5
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This seems to be fixed as of PHP 5.4.0[1], or are some entities
still missing?
> The DomDocument->saveXML gives an error when certain characters
> within the document, specially the right-single-quotation (U+2019)
> and several other characters.
That shouldn't be an issue if the document encoding is UTF-8.
[1] <https://3v4l.org/sPH1k>
Previous Comments:
------------------------------------------------------------------------
[2009-08-20 00:38:08] chiestand at salk dot edu
This is still a problem in PHP 5.2.5 on both my Linux and OS X 10.5 platforms.
In my case the problematic character was "ï¬", which crashed DOMDocument::saveXML()
with error "xmlEscapeEntities:char out of range"
------------------------------------------------------------------------
[2006-03-17 23:09:26] morgan at forsalebyowner dot com
Ran into this problem while trying to generate an xml document using the DomDocument object. The
DomDocument->saveXML gives an error when certain characters within the document, specially the
right-single-quotation (U+2019) and several other characters. An attempt to convert the entities to
HTML using htmlentities failed because the characters are not in the html_translation_table.
------------------------------------------------------------------------
[2005-09-21 11:35:43] mark_meredith at shaw dot ca
Description:
------------
Some special characters, Symbols, and Latin-1 chararacters.
Are
missing from get_html_translation_table
(HTML_ENTITIES,ENT_QUOTES)
The xhtml Special character lsquo and rsquo (left and right
single quote are missing for instance). And a lot of
entities from the W3C provided xhtml-symbol.ent, xhtml-
special.ent, and xhtml-lat1.ent files are missing.
You can download these files from http://www.w3.org/TR/
xhtml1/dtds.html
It also seems strange how all of this was implemented
considering there are three files of entities. There really
should be 3 separate functions for converting these
characters to their entity equivalents as well as one
function that will convert all entities.
Reproduce code:
---------------
print('<pre>'.print_r(get_html_translation_table
(HTML_ENTITIES,ENT_QUOTES),1).'</pre>');
/*:NOTE: then compare to the contents of the entity files located at http://www.w3.org/TR/
xhtml1/dtds.html*/
Expected result:
----------------
Should have every known entity, and divisions between what
type of entity it is.
Actual result:
--------------
Is missing a lot of entities like ’ from xhtml-
special.ent
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=34577&edit=1
Thread (5 messages)