Unix Technical Forum

ascii() for utf8

This is a discussion on ascii() for utf8 within the Pgsql General forums, part of the PostgreSQL category; --> Does Postgresql have a function like ascii() that will return the unicode codepoint value for a utf8 character? (And ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008, 06:34 PM
Stuart
 
Posts: n/a
Default ascii() for utf8


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.



---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-09-2008, 06:35 PM
Decibel!
 
Posts: n/a
Default Re: ascii() for utf8

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@decibel.org
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)



---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org/

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:35 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com