Skip site navigation (1) Skip section navigation (2)

python - be: Implement encoding "choregraphy".

From: jwp(at)pgfoundry(dot)org (James William Pye)
To: pgsql-committers(at)postgresql(dot)org
Subject: python - be: Implement encoding "choregraphy".
Date: 2005-06-29 23:40:13
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committers
Log Message:
Implement encoding "choregraphy".

This fixes issues with reading unicode strings in procedures by specifying the
encoding using the magic comment # -*- encoding: utf-8 -*-. In addition, set the
default unicode encoding after initializing the Postgres interface module.

The interface module now includes an encoding portion that adds PostgreSQL
aliases. This makes using PostgreSQL encoding names with Python seamless.

Add Encoding and EncodingCode to the Postgres module. These functions get the
database's encoding. EncodingCode returns the database's pg_enc, and Encoding
returns the database's encoding as a string(note, translated to the Python
encoding name). (Perhaps an EncodingCodeName should be added as well to get
the database's encoding as a PostgreSQL encoding name).

To do next: translate the procedure source to utf-8 before compilation. After
this, plpy should fully support/recognize the database's encoding.

Modified Files:
        ci.h (r1.2 -> r1.3)
        cis.h (r1.3 -> r1.4)
        fund (r1.2 -> r1.3)
        pl.c (r1.19 -> r1.20)
        function.c (r1.6 -> r1.7)
        module.c (r1.16 -> r1.17)

Added Files:
        encoding.h (r1.1)
        encoding.c (r1.1)

pgsql-committers by date

Next:From: Tom LaneDate: 2005-06-30 00:00:52
Subject: pgsql: Improve the checkpoint signaling mechanism so that the bgwriter
Previous:From: User BuilderDate: 2005-06-29 23:11:29
Subject: bizgres - bizgres: Introduce release Release-0_6_1

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group