encoding and locale

Started by Christian Traberover 20 years ago3 messagesgeneral
Jump to latest
#1Christian Traber
christian@traber-net.de

I'm using postgres8 with encoding 'UNICODE'.
I have some problems with unsupported mutlibyte... e.g. with upper()

Now I know a I cannot use every lc_ctype with every encoding,
but where can I find a list of valid encoding/locale combinations?

regards
Christian

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Christian Traber (#1)
Re: encoding and locale

Christian Traber <christian@traber-net.de> writes:

Now I know a I cannot use every lc_ctype with every encoding,
but where can I find a list of valid encoding/locale combinations?

If there were a standardized way of finding that out, we'd long since
have made Postgres take advantage of it to prevent use of non-working
combinations. But there's not.

The best bet usually is to look at the output of "locale -a", and see
if you can figure out the naming convention used for the locales.

regards, tom lane

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Christian Traber (#1)
Re: encoding and locale

Christian Traber wrote:

Now I know a I cannot use every lc_ctype with every encoding,
but where can I find a list of valid encoding/locale combinations?

Try something like the following:

for x in $(locale -a); do echo -n "$x: "; LC_ALL=$x locale charmap; done

Unfortunately, the name of the encoding that the locale system uses
might differ from the locale name that PostgreSQL uses, so you will
have to be able to see through that.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/