emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/pq 966a05ef25 07/63: Initialize client_encoding to utf8


From: ELPA Syncer
Subject: [elpa] externals/pq 966a05ef25 07/63: Initialize client_encoding to utf8.
Date: Mon, 14 Feb 2022 23:24:18 -0500 (EST)

branch: externals/pq
commit 966a05ef255dcbdfda0612a80b6b9c0fba1bb802
Author: Andreas Seltenreich <andreas+git@ansel.ydns.eu>
Commit: Andreas Seltenreich <andreas+git@ansel.ydns.eu>

    Initialize client_encoding to utf8.
    
    The emacs-module interface always yields/expects utf8 strings.
---
 pq.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pq.c b/pq.c
index f21a27a459..06e1232632 100644
--- a/pq.c
+++ b/pq.c
@@ -74,6 +74,12 @@ Fpq_connectdb (emacs_env *env, int nargs, emacs_value 
args[], void *data)
     return Qnil;
   }
   fprintf(stderr, "PQconnectdb(%s) -> %p\n", conninfo, conn);
+
+  /* The emacs-module interface always expects utf8 strings */
+  PGresult *res = PQexec(conn, "set client_encoding to utf8");
+  if (!result_ok(env, res))
+    return Qnil;
+
   if (nargs)
     free(conninfo);
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]