php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14148 utf8_encode seems to return a not-null-terminated string
Submitted: 2001-11-20 08:51 UTC Modified: 2001-11-20 11:41 UTC
From: jochen at keutel dot de Assigned:
Status: Closed Package: *XML functions
PHP Version: 4.0.6 OS: Solaris 2.7
Private report: No CVE-ID: None
 [2001-11-20 08:51 UTC] jochen at keutel dot 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.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-20 11:41 UTC] 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 11:41 UTC] 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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 10:01:28 2024 UTC