On Tue, Jun 20, 2006 at 06:10:38PM -0400, Tom Lane wrote: > > Should we get firmer in rejecting invalid configurations? > > The question is how sure are we whether a configuration is "invalid". > AFAIK there's not a really portable way to determine which encoding > matches a locale. initdb has a kluge that seems to work most of the > time, but do we want the database to refuse to start when it doesn't?
Well, this "kludge" is the recommended and documented way to do it on glibc based systems as well as many others. It turns out however that there is a libcharset[1] for portably determining the charset for your current locale. What's most interesting about it is that it has tables for various OSes and mappings from their names to standard names (the ones used by Glibc). It's LGPL so we can't include the stuff verbatim, but it's not a lot of code. I'm not sure why we persist in beleiving this test is so unreliable we won't even emit a warning... [1] http://www.haible.de/bruno/packages-libcharset.html Have a nice day, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate.
signature.asc
Description: Digital signature