Re: More message encoding woes
| От | Tom Lane |
|---|---|
| Тема | Re: More message encoding woes |
| Дата | |
| Msg-id | 2233.1238419928@sss.pgh.pa.us обсуждение |
| Ответ на | More message encoding woes (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>) |
| Ответы |
Re: More message encoding woes
|
| Список | pgsql-hackers |
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> In CVS HEAD, we call bind_textdomain_codeset() in SetDatabaseEncoding()
> which fixes that, but we only do it on Windows. In earlier versions we
> called it on all platforms, but only for UTF-8. It seems that we should
> call bind_textdomain_codeset on all platforms and all encodings.
Yes, this problem has been recognized for some time.
> However, there seems to be a reason why we only do it for Windows on CVS
> HEAD: we need a mapping from our encoding ID to the OS codeset name, and
> the OS codeset names vary.
> How can we make this more robust?
One possibility is to assume that the output of nl_langinfo(CODESET)
will be recognized by bind_textdomain_codeset(). Whether that actually
works can only be determined by experiment.
Another idea is to try the values listed in our encoding_match_list[]
until bind_textdomain_codeset succeeds. The problem here is that the
GNU documentation is *exceedingly* vague about whether
bind_textdomain_codeset behaves sanely (ie throws a recognizable error)
when given a bad encoding name. (I guess we could look at the source
code.)
regards, tom lane
В списке pgsql-hackers по дате отправления: