[turba] Re: Problem with French Characters
Pär Aronsson
par.aronsson@nohup.se
14 Sep 2002 22:26:45 +0200
---------------------- multipart/mixed attachment
I've given it a shot Chuck.
I get an error when I try to add an entry, with or without special
chars, though. The following is displayed in my browser.
******
Warning: Array to string conversion in
/var/www/html/ssl/horde/turba/lib/Driver/ldap.php on line 306
=20
Fatal error: Call to undefined function: addparameter() in
/var/www/html/ssl/horde/turba/addobjectaction.php on line 37
*****
I added your new code to the setObject function and, voila, it is now
possible to edit an existing entry to contain special chars. I've
attached a very small and simple patch that enables this feature.
I'll be a happy surfer when this is finally fixed. Thanks for looking
into it Chuck.
// P=E4r Aronsson
On Fri, 2002-09-13 at 21:47, Chuck Hagenbuch wrote:
> Quoting Chuck Hagenbuch <chuck@horde.org>:
>=20
> > You're right; I was being sloppy in my searching (just noticed the enco=
de
> > was there). Can anyone see any problem with running all of the attribut=
es
> > through utf8_encode() in addObject() if encoding =3D 'utf8' is set?
>=20
> I've committed this to CVS - someone with the problem or who has a direct=
ory
> set to use utf8, please try it out and give feedback (and everyone else, =
let
> me know if it breaks anything, though it shouldn't touch any other code..=
.).
>=20
> -chuck
---------------------- multipart/mixed attachment
*** ldap.php Sat Sep 14 21:53:17 2002
--- ldap.php.new Sat Sep 14 22:07:29 2002
***************
*** 372,377 ****
--- 372,384 ----
}
}
=20
+ // Encode entries in UTF-8 if requested.
+ if ($this->encoding =3D=3D 'utf8') {
+ foreach ($attributes as $key =3D> $val) {
+ $attributes[$key] =3D utf8_encode($val);
+ }
+ }
+=20
unset($attributes[$object_key]);
$attributes =3D array_filter($attributes, array($this, 'cleanEmpt=
yAttributes'));
=20
---------------------- multipart/mixed attachment--