#39665 [Opn->Fbk]: would like to make a direct call to html_entity_decode() from C/C++
| From: | derick@php.net | Date: | Tue, 28 Nov 2006 20:33:06 +0000 |
| Subject: | #39665 [Opn->Fbk]: would like to make a direct call to html_entity_decode() from C/C++ | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-105599@lists.php.net to get a copy of this message | ||
ID: 39665
Updated by: derick@php.net
Reported By: drew at folta dot net
-Status: Open
+Status: Feedback
-Bug Type: Unknown/Other Function
+Bug Type: Feature/Change Request
PHP Version: 5.2.0
New Comment:
Do you have a patch?
Previous Comments:
------------------------------------------------------------------------
[2006-11-28 20:30:17] drew at folta dot net
Description:
------------
(Sorry, I didn't know which type of bug to file this as.)
I'm writing a php extension in C++. I would like to call
html_entity_decode() right from C++. Looking in the source, I see that
html_entity_decode() is just a wrapper around
php_unescape_html_entities(). Alas, this function is not mentioned in
the ext/standard/html.h header file.
This feature request is that the declaration of the
php_unescape_html_entities() function be put in the ext/standard/html.h
header file.
I *do* have a work-around for this. If I declare the function myself,
than I can use it. This works well, but is probably bad practice.
Reproduce code:
---------------
#include "ext/standard/html.h"
char *old, *new;
int new_len;
old = estrdup("a&b");
new = php_unescape_html_entities(
(unsigned char *) old, strlen(old), &new_len, 1,
ENT_COMPAT, NULL TSRMLS_CC
);
printf("old[%s] new[%.*s]", old, new_len, new);
Expected result:
----------------
old[a&b] new[a&b]
Actual result:
--------------
won't compile:
implicit declaration of function `int php_unescape_html_entities(...)'
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39665&edit=1