Re: [Modeling-users] type('') and unicode
Status: Abandoned
Brought to you by:
sbigaret
|
From: Yannick G. <yan...@sa...> - 2003-07-16 18:12:09
|
=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On July 16, 2003 02:05 pm, Yannick Gingras wrote:
> What I said earlier is that I manually utf-8 encode every thing the I
> *store* in the DB. I thought that I might be safe with queries but
> well, utf-8 encoding queries too is not that much work.
Like this (since I make my qualifiers by hand, I have nice spot to
trap unicode requests) :
def makeMatchQual(self, key, matchType, matchPatern):
if type(matchPatern) =3D=3D type(u""):
matchPatern =3D matchPatern.encode("utf-8")
=20
if matchType =3D=3D LK:
return Qualifier.KeyValueQualifier(key ,
=20
Qualifier.QualifierOperatorLike,
"*%s*" % matchPatern)
[...]
=2D --=20
Yannick Gingras
Byte Gardener, Savoir-faire Linux inc.
(514) 276-5468
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD4DBQE/FZV2rhy5Fqn/MRARAowZAJ9zT4CtWCHmsfXzYXM6COCzmMON3QCVFlej
r/fWHWx1Kedjga7JhkuvEw=3D=3D
=3DQJ9u
=2D----END PGP SIGNATURE-----
|