It seems that by default the Postgresql server and frontend use the SQL_ASCII
encoding. Given the Red Hat quest for Unicode "domination" :-), wouldn't it be
better to switch defaults to Unicode?
Besides, a utf-8 terminal and a psql using SQL_ASCII encoding do not get along
very well :-(.
- Switch initdb's default encoding to Unicode.
- For psql, either:
- have a /etc/skel/.psqlrc with "\encoding utf-8" (does not affect existing
- add some magic to psql to determine whether the controlling tty has
Unicode capability and set encoding accordingly (quick hack: check if LANG
ends with ".UTF-8"?)
I will think about this. Thanks for the suggestions.
For the time being (to maintain regression test passes, among other reasons), I
am going to keep the default encoding the way it is. Client encoding can be
changed in dotfiles as you suggest. Databases can be initialized with other
default encodings using `initdb --encoding=<encoding> -D <location of data