From 8f1619fc62195270ea2ff7ea9d4981639f53292b Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Fri, 23 Feb 2024 14:31:03 -0600 Subject: [PATCH] Set client-side connection encoding --- examples/etc/pgwui.ini | 12 +++++++++++- examples/misc/development.ini | 6 ++++++ src/pgwui_server/pgwui_server.py | 3 ++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/examples/etc/pgwui.ini b/examples/etc/pgwui.ini index 7fb9a2e..418378e 100644 --- a/examples/etc/pgwui.ini +++ b/examples/etc/pgwui.ini @@ -25,11 +25,21 @@ use = egg:PGWUI_Server pgwui.pg_host = pgwui.pg_port = 5432 - # The database to use by default. # Not having the setting is the same as "", the empty string. # pgwui.default_db = +# The encoding used for strings on the client-side. +# This setting defaults to "auto", the special PostgreSQL value which +# sets the client_encoding based on the encoding of the client +# system's locale. +# Set this value to "", the empty string, to use the server's encoding +# as the client encoding. (pgwui.client_encoding =) (or just omit the +# declaration) +# The list of PostgreSQL encodings can be found at: +# https://www.postgresql.org/docs/current/multibyte.html#MULTIBYTE-CHARSET-SUPPORTED +# pgwui.client_encoding = auto + # How to link to the site's home page. # diff --git a/examples/misc/development.ini b/examples/misc/development.ini index 0712b36..8a38a37 100644 --- a/examples/misc/development.ini +++ b/examples/misc/development.ini @@ -29,6 +29,12 @@ pgwui.pg_port = 5432 # Not having the setting is the same as "", the empty string. # pgwui.default_db = +# The encoding used for strings on the client-side. +# This setting defaults to "auto", the special PostgreSQL value which +# sets the client_encoding based on the encoding of the client +# system's locale. +# pgwui.client_encoding = auto + # How to link to the site's home page. Useful when the home page is # not the PGWUI menu. diff --git a/src/pgwui_server/pgwui_server.py b/src/pgwui_server/pgwui_server.py index 85e16e4..2efa4ac 100644 --- a/src/pgwui_server/pgwui_server.py +++ b/src/pgwui_server/pgwui_server.py @@ -1,4 +1,4 @@ -# Copyright (C) 2018, 2019, 2020, 2021 The Meme Factory, Inc. +# Copyright (C) 2018, 2019, 2020, 2021, 2024 The Meme Factory, Inc. # http://www.karlpinc.com/ # This file is part of PGWUI_Server. @@ -44,6 +44,7 @@ SETTINGS = set( ['pg_host', 'pg_port', 'default_db', + 'client_encoding', 'dry_run', 'route_prefix', 'validate_hmac', -- 2.34.1