Palle Girgensohn <girgen(at)pingpong(dot)net> writes:
> hmm... I think I might have made a false assumption that
> the locale string would contain the character encoding.
You certainly cannot assume that. Would that it were so easy to find
out the character set for a locale :-(.
There's some code in initdb that you might emulate, though I can't say
that I trust it a whole lot.
regards, tom lane