GNU bug report logs - #54591
29.0.50; sqlite-select returns blob result as multibyte string

Previous Next

Package: emacs;

Reported by: Yuan Fu <casouri <at> gmail.com>

Date: Sun, 27 Mar 2022 05:50:02 UTC

Severity: normal

Found in version 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #29 received at 54591 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Johannes Grødem <fjas <at> grdm.no>
Cc: 54591 <at> debbugs.gnu.org
Subject: Re: bug#54591: 29.0.50;
 sqlite-select returns blob result as multibyte string
Date: Sat, 02 Apr 2022 08:31:52 +0300
> From: Johannes Grødem <fjas <at> grdm.no>
> Date: Fri, 01 Apr 2022 20:34:49 +0200
> 
> In Python's SQLite3 API, ordinary strings are inserted as SQLite TEXTs
> and bytestrings are inserted as SQLite BLOBs, and returned as the same
> when you query. It's using a function similar to row_to_value for this,
> except that it for some reason doesn't switch on SQLITE_BLOB, it just
> calls sqlite3_column_blob and tests if it returns NULL or not and then
> it does a switch on the remaining types.

This would be leaving the responsibility for the issue to the caller,
I think.  Does SQLite TEXT allow the superset of UTF-8 encoding Emacs
uses internally to store characters that are not in Unicode?  If it
does, we could indeed assume that any BLOB is binary data and not
attempt encoding/decoding it.

> Couldn't the Emacs interface just use vectors of byte values for BLOBs
> both ways?

Why?  Unibyte strings are easier and more flexible in Emacs.

Thanks.




This bug report was last modified 3 years and 22 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.