RE: [PEAR] DB_DataObject UTF-8 with PostgreSQL
| From: | Beni Buess | Date: | Fri, 21 Jan 2005 09:56:28 +0000 |
| Subject: | RE: [PEAR] DB_DataObject UTF-8 with PostgreSQL | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-17075@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Justin Patrin [mailto:papercrane@gmail.com]
> Sent: Wednesday, January 19, 2005 7:22 PM
> To: Beni Buess
> Cc: pear-general@lists.php.net
> Subject: Re: [PEAR] DB_DataObject UTF-8 with PostgreSQL
>
> On Wed, 19 Jan 2005 11:16:49 +0100, Beni Buess
> <beni.buess@swisslog.com> wrote:
> > Hi list,
> >
> > I'm working with a UTF-8 encoded PostgreSQL DB and
> DB_DataObjects. I've the problem that there is something
> going wrong with these multibyte strings coming from the DB
> inside DB_DataObject, since I haven't this problem when I
> only use PEAR::DB.
> >
> > Does anybody have an idea where the problem is and what i
> can do to tell DB_DataObject that it should handle multibyte strings?
> >
>
> Are you doing something special with DB to get the MB strings
> back? A special query or function call? What's wrong with the
> strings from DB_DataObject?
I don't think that I'm doing something special, just $do->find() after some addWhere(),
then $do->fetch() in a while loop. When i do mb_detect_encoding() on the string, i get UTF-8, and
thats what i need, but my browser as well as the debugger shows me some strange characters instead
of the for example swedish special characters (for example: "AarsA¦ther VardA?" instead
of "Aarsæther Vardø"). the meta-tag to tell the browser that the content is utf-8
encoded is there.
i've done a similar application with just PEAR::DB, and there are no problems with these
mb-strings. they are coming from the same DB. But since i use DB_DataObjects, the strings are just
not shown as they should. I think that there are some string functions in DB_DataObjects, that do
not correctly handle mb-strings, and therefore cause the problems, but i've nothing found
during debugging.
the only difference to my first solution without DataObjects is, that DataObjects gets the result
using DB::fetch() and i've used DB::getAll(), but i think getAll() uses fetch() insinde, so
this is IMHO not the problem.
Regards
Beni
>
> --
> Justin Patrin
>
> ____________________________________________________________
> This message has been checked for all known viruses by Messagelabs.
>
____________________________________________________________
This message may contain legally privileged or confidential
information and is therefore addressed to the named persons only.
The recipient should inform the sender and delete this message,
if he/she is not named as addressee.
The sender disclaims any and all liability for the integrity
and punctuality of this message.
The sender has activated an automatic virus scanning by
Messagelabs, but does not guarantee the virus free
transmission of this message.