Re: ascii() for utf8

From: Decibel! <decibel(at)decibel(dot)org>
To: Stuart <smcg2297(at)frii(dot)com>
Cc: PostgreSQL-development list <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ascii() for utf8
Date: 2007-07-31 01:09:46
Message-ID: 086D8F84-5D66-44CF-817F-D26D2E9556DB@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Moving to -hackers.

On Jul 27, 2007, at 1:22 PM, Stuart wrote:
> 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.

I suspect that this is just a matter of no one scratching the itch. I
suspect a patch would be accepted, or you could possibly put
something on pgFoundry. I'd set it up so that ascii() and chr() act
according to the appropriate locale setting (I'm not sure which one
would be appropriate).
--
Decibel!, aka Jim Nasby decibel(at)decibel(dot)org
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2007-07-31 01:11:02 Re: pg_dump
Previous Message Decibel! 2007-07-31 00:58:14 Re: plperl syntax highlighting for vi

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2007-07-31 01:25:03 Re: default_text_search_config and expression indexes
Previous Message twraney 2007-07-30 22:36:12 Building Hash Index by Presorting Tuples