PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB » Bug #363

No support for specifying desired character set

Details

Submitted2003-12-05 19:30 UTC
Fromdilinger at voxel dot net
Assigneddanielc
StatusWont fix
PackageDB
PHP Version4.3.3
OSLinux
Roadmaps(Not assigned)

Comments

[2003-12-05 19:30 UTC] dilinger at voxel dot net

Description:
------------
It would be nice if DB supported a way to specify which character set should be used. Some databases support this, and some don't, which is why a DB wrapper would be very nice.

For example, a project I'm working on uses MySQL 3 for storage; data is entered in whatever character set the user's browser is using, and converted to latin1 when entered into the database. This causes problems when using xml functions that expect UTF-8. The obvious solution is to use php's iconv (or mbstring) functionality to automatically convert POST/GET input to UTF-8. Unfortunately, when doing a database SELECT, the results will still be in latin1. MySQL only supports UTF-8 in version 4.1 (which is not yet stable). DB could help me out here, if it had a way to specify what encoding results should be returned as, and translate them when returning result strings. If we decide to switch to another database, we wouldn't have to worry about whether the new database supports the encoding, either.

Unfortunately, this would require a dependency upon iconv or mbstring, both of which are extra php4 configuration options.

[2005-04-27 10:22 UTC] e-mail at dreamguard dot at

don't understand why you think this is 'out of the scope' of DB package. well in the mysql part you're maybe right. but in my case i'm using postgre and just wan't to do the same as 'pg_client_encoding' function in php does. would be quite nice if you could add this at least to the postgre part of db.