Ok, here comes what I've done so far for adding Unicode
support. Jjust to show what I've been talking about on
the mailing list and by no means finished or bugfree.
Bugs are (at least):
- no checks if PostgreSQL multibyte support is
available at all (compiles may perhaps fail)
- for some reason, no exception is raised when setting
the clientencoding fails
Logged In: YES
user_id=163326
I'm publishing here my update to the patch. This patch is
against the latest CVS version of pyPgSQL. It turns out that
changes to libpq are not necessary at all. Some testing code
is already there and I'm pretty confident that I'm on the
right track with the current approach.
More later.
Logged In: YES
user_id=163326
Hmm. The patch is pretty large. So one more comment: The
only relevant addition is the __unicodeConvert() method in
the Connection class. The other relevant changes can be
found by grepping for "unicode".
There's also cosmetic changes to the typechecking in this
patch (always use "is" instead of "==" and "is not" instead
of "!="). And also always compare to "None" with "is" - the
comparison with "==" has bitten a pyPgSQL user once. The
is-Check is more pythonic and slightly faster.
Enough for today :)
Unicode patch for pyPgSQL 2.1
Logged In: YES
user_id=163326
I've now uploaded an updated patch that applies cleanly to
pyPgSQL version 2.1. I'd be very grateful if those
interested in Unicode support could test it and tell me (on
the mailing list, preferrably) what should be done
differently and which features are still missing, if any.
Logged In: YES
user_id=163326
The patch still applies cleanly to pyPgSQL 2.2.
Logged In: YES
user_id=163326
Applied in revision 1.18 of PgSQL.py.