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

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

[nongnu] elpa/emacsql 3cec7dcb20: Use utf-8 coding-system instead of utf


From: ELPA Syncer
Subject: [nongnu] elpa/emacsql 3cec7dcb20: Use utf-8 coding-system instead of utf-8-auto
Date: Tue, 17 Jan 2023 11:59:00 -0500 (EST)

branch: elpa/emacsql
commit 3cec7dcb201568a09ee9cebf0ea1e43cba9d334a
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Use utf-8 coding-system instead of utf-8-auto
    
    This fixes an issue that was merely triggered by a change in Emacs
    [1].  [2: 127bb98] started binding `coding-system-for-write' and
    `coding-system-for-read' to `utf-8-auto'.  As Eli points out at [3]
    `utf-8-auto' was probably a mistake and `utf-8' should have been
    used instead.
    
    1: https://github.com/emacsmirror/emacs/commit/cfd2b3504ab5de6eb5
    
    2: 2014-02-02 127bb98df20d84117d34822f50ea584af81b19c3
       Set coding system to utf-8-auto for sqlite.
    
    3: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60872#11.
    
       > Setting coding-system-for-write to utf-8-auto makes no sense;
       > that coding-system's _only_ raison d'ĂȘtre is for using in
       > coding-system-for-read, i.e. when decoding stuff that may or
       > may not start with a BOM.
    
    Since EmacSQL is not a general-purpose database but instead stores
    data encoded by Emacs for later retrieval by Emacs only, we do not
    have to with the unlikely appearance of a BOM, so we can use `utf-8'
    instead of `utf-8-auto' for writes *and* reads.
    
    Re #104, #106, magit/forge#533, magit/forge#535, bug#60872.
---
 emacsql-sqlite.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/emacsql-sqlite.el b/emacsql-sqlite.el
index 1193147b62..7b8876fe92 100644
--- a/emacsql-sqlite.el
+++ b/emacsql-sqlite.el
@@ -73,8 +73,9 @@ used.")
   ((connection emacsql-sqlite-connection) &rest _rest)
   (emacsql-sqlite-ensure-binary)
   (let* ((process-connection-type nil)  ; use a pipe
-         (coding-system-for-write 'utf-8-auto)
-         (coding-system-for-read 'utf-8-auto)
+         ;; See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60872#11.
+         (coding-system-for-write 'utf-8)
+         (coding-system-for-read 'utf-8)
          (file (slot-value connection 'file))
          (buffer (generate-new-buffer " *emacsql-sqlite*"))
          (fullfile (if file (expand-file-name file) ":memory:"))



reply via email to

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