[Zope] DTML-SQLVAR and Unicode and PostgreSQL

Glenn R Williams gloonie@earthlink.net
21 May 2003 17:58:34 -0400


--=-5FWed8isZq98/3if4wOZ
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Thanks Dieter,

I got one step further: the PostgreSQL log shows my query with converted
HTML entites:

LOG:  query: select * from xp_name
              where original_name =3D            =20
              'عامررشيد'

As you can see, this is not what I want! But how do I tell Zope to use
utf8 encoding for the query? When building the query in Zope, I
specified as an argumen "original_name:ustring". However, the actual
query in the Z SQL method only allows a type of "string".=20

Am I doing something wrong?

Thanks,

Glenn



On Wed, 2003-05-21 at 14:59, Dieter Maurer wrote:
> Glenn R Williams wrote at 2003-5-20 16:42 -0400:
>  > I am trying to set up a simple retrieval of data in my PostgreSQL
>  > database. The input (in Arabic) has to be in unicode. I can specify an
>  > argument of 'arabic_name:ustring' and that is accepted okay. However,
>  > something happens between the submission of the form and the execution
>  > of the query in the PostgreSQL backend, and no data is returned.
> =20
> The unicode string will probably be somehow encoded before
> it is sent to Postgres. This encoding is probably the wrong one.
>=20
> I would increase the PostgreSQL log level sufficiently that
> it logs the queries. Then, I would compare the failing (from Zope)
> and succeeding (from "psql") queries and determine the correct encoding.
>=20
> Then, I would explicitely call for this encoding.
>=20
>=20
> Dieter
--=20
Glenn R Williams
Ghoti Software
----------------------------------------------------------------------
Mathematical theories are the part of science you could continue to do
if you woke up tomorrow and discovered the universe was gone.

--=-5FWed8isZq98/3if4wOZ
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQA+y/aJQ0pkIU7d8owRAo6tAJ0UmLpMKu22o6ppISk9hoiHLbvkfQCfc/9l
wyBUfLEBLWe2bgjch7zFy5M=
=5VcH
-----END PGP SIGNATURE-----

--=-5FWed8isZq98/3if4wOZ--