Re: libpq Unicode support?

From: Ben <bench(at)silentmedia(dot)com>
To: Ale Raza <araza(at)esri(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: libpq Unicode support?
Date: 2005-04-22 20:37:58
Message-ID: Pine.LNX.4.44.0504221337150.26998-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Why would you? UTF-16 and UTF-8 are just different representations for the
same domain of characters.

On Fri, 22 Apr 2005, Ale Raza wrote:

> Are we not going to lose some characters if we are putting a UTF-16 to UTF-8
> translation in front of libpq?
>
> Ale.
>
> -----Original Message-----
> From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
> Sent: Friday, April 22, 2005 12:14 PM
> To: Bruce Momjian
> Cc: Ale Raza; pgsql-general(at)postgresql(dot)org
> Subject: Re: [GENERAL] libpq Unicode support?
>
>
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Tom Lane wrote:
> >> Oh? Who's working on it, or even interested? Was there discussion
> >> of adding it to TODO?
>
> > TODO has:
>
> > o Add support for Unicode
>
> > To fix this, the data needs to be converted to/from UTF16/UTF8
> > so the Win32 wcscoll() can be used, and perhaps other functions
> > like towupper(). However, UTF8 already works with normal
> > locales but provides no ordering or character set classes.
>
> That's completely unrelated --- it's talking about making correct use of
> Windows' locale support in one small bit inside the server.
>
> To make libpq UTF-16 capable, we'd have to change its API for all
> strings; either make the strings counted rather than null-terminated,
> or make the string elements wchar instead of char. After that we'd
> have to hack the FE/BE protocol too (or more likely, require libpq
> to translate UTF-16 to UTF-8 before sending to the server). I don't
> foresee anyone doing any of this, at least not in the near term.
>
> Putting a UTF-16 to UTF-8 translation in front of libpq seems a lot
> more practical.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
> joining column's datatypes do not match
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2005-04-22 20:46:55 Re: libpq Unicode support?
Previous Message Rich Shepard 2005-04-22 20:30:17 Re: Migrating MySQL app to postgres?