ascii() for utf8

From: "Stuart" <smcg2297(at)frii(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: ascii() for utf8
Date: 2007-07-27 18:22:04
Message-ID: f8dd4d$246$1@sea.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers


Does Postgresql have a function like ascii() that will
return the unicode codepoint value for a utf8 character?
(And symmetrically same for question chr() of course).

I didn't find anything in the docs so I think the answer
is no which leads me to ask... Why not? (Hard to believe
lack of need without concluding that either ascii() is
not needed, of utf8 text is little used.)

Are there technical problems in implementing such a
function? Has anyone else already done this (ie, is
there somewhere I could get it from?)

Is there some other non-obvious way to get the cp value
for the utf8 character?

I think I could use plperl or plpython for this but
this seems like an awful lot of overhead for such a
basic task.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lincoln Yeoh 2007-07-27 18:23:57 How best to represent relationships in a database generically?
Previous Message Paolo Victor 2007-07-27 17:54:45 Re: How do I create a database if I can't connect to it?

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2007-07-27 18:26:26 Re: [PATCHES] allow CSV quote in NULL
Previous Message Stephen Frost 2007-07-27 18:09:52 Re: [PATCHES] allow CSV quote in NULL