注意: 作者是 Oleg Bartunov.请参阅 Oleg 的主页 获取关于本地化和俄语支持的附加信息.
人们经常抱怨说他们的(Postgres)本地化不能正常工作.下面是一些常见错误:
#!/bin/sh export LC_CTYPE=koi8-r export LC_COLLATE=koi8-r postmaster -B 1024 -S -D/usr/local/pgsql/data/ -o '-Fe'然后从 rc.local 里运行之
/bin/su - postgres -c "/home/postgres/runpostgres"OS 内损坏了的本地支持(例如,Linux下 libc 里的本地支持有时被修改过了,这样会造成许多麻烦).最新的 perl 也支持本地化并且如果本地化被损坏了,使用 perl -v 将报下面的错:
8:17[mira]:~/WWW/postgres>setenv LC_CTYPE not_exist
8:18[mira]:~/WWW/postgres>perl -v
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LC_CTYPE = "not_exist",
LANG = (unset)
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
W本地化文件位置放错了!可能的路径包括:/usr/lib/locale (Linux,
Solaris),/usr/share/locale (Linux),/usr/lib/nls/loc
(DUX 4.0).使用 man locale 找出正确的路径.在 Linux 下我在 /usr/lib/locale
和 /usr/share/locale 之间做了一个符号链接以确保下一个 libc 版本不会破坏我的本地设置.