Bug #14148: utf8_encode seems to return a not-null-terminated string

From: Date: Tue, 20 Nov 2001 13:51:06 +0000
Subject: Bug #14148: utf8_encode seems to return a not-null-terminated string
Groups: php.dev 
Request: Send a blank email to php-dev+get-71077@lists.php.net to get a copy of this message
From: jochen@keutel.de 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

« previous php.dev (#71077) next »