From:             [EMAIL PROTECTED]
Operating system: Solaris 2.7
PHP version:      4.0.6
PHP Bug Type:     *XML functions
Bug description:  utf8_encode seems to return a not-null-terminated string

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 bug report at: http://bugs.php.net/?id=14148&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to