Bug #14148 Updated: utf8_encode seems to return a not-null-terminated string
| From: | venaas@php.net | Date: | Tue, 20 Nov 2001 16:41:34 +0000 |
| Subject: | Bug #14148 Updated: utf8_encode seems to return a not-null-terminated string | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-71096@lists.php.net to get a copy of this message | ||
ID: 14148
Updated by: venaas
Reported By: jochen@keutel.de
Old Status: Open
Status: Closed
Bug Type: *XML functions
Operating System: Solaris 2.7
PHP Version: 4.0.6
Previous Comments:
------------------------------------------------------------------------
[2001-11-20 11:41:12] venaas@php.net
You're right, this was fixed in CVS in July.
You might try 4.1 when it is released, or get the
RC from http://www.php.net/~zeev/php-4.1.0RC3.tar.gz
RC3 seems to be the latest at the moment.
------------------------------------------------------------------------
[2001-11-20 08:51:05] jochen@keutel.de
I'm using utf8_encode together with LDAP functions.
E.g.
filter: sn=müller
(ü: german umlaut)
ldap_search ($ds,"c=de",$filter,$attrs);
doesn't work because filter contains invalid characters.
So:
$utf8_filter = utf8_encode ($filter);
ldap_search ($ds,"c=de",$utf8_filter,$attrs);
But this also doesn't work.
The logfile of my LDAP server (Siemens DirX)
shows some extra bytes in the end of the filter
value.
The reason seems to be that
xml_utf8_encode (in ext/xml/xml.c)
doesn't set the last byte of the string to "\0".
(xml_utf8_decode sets the null byte correctly ...)
Bye,
Jochen.
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=14148&edit=1