Default to using the ASCII table. However, if a UTF-8 locale codeset is in use, switch to the UTF-8 table.
Signed-off-by: Roger Leigh <rle...@debian.org> --- src/bin/psql/print.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c index 9dec77d..6f5dcd4 100644 --- a/src/bin/psql/print.c +++ b/src/bin/psql/print.c @@ -21,6 +21,9 @@ #endif #include <locale.h> +#ifdef HAVE_LANGINFO_H +#include <langinfo.h> +#endif #include "catalog/pg_type.h" #include "pqsignal.h" @@ -2232,7 +2235,13 @@ IsPagerNeeded(const printTableContent *cont, const int extra_lines, FILE **fout, void printTable(const printTableContent *cont, FILE *fout, FILE *flog) { - bool is_pager = false; + bool is_pager = false; + const printTextFormat *text_format = &asciiformat; + +#if (defined(HAVE_LANGINFO_H) && defined(CODESET)) + if (!strcmp(nl_langinfo(CODESET), "UTF-8")) + text_format = &utf8format; +#endif if (cancel_pressed) return; -- 1.6.3.3 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers