From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Johannes =?UTF-8?Q?Gr=C3=B8dem?= Newsgroups: gmane.emacs.bugs Subject: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string Date: Sat, 02 Apr 2022 08:33:55 +0200 Message-ID: <87ilrsro30.fsf@flokut.localdomain> References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> <87a6d672xr.fsf@gnus.org> <878rso7iuu.fsf@flokut.localdomain> <83r16g3vav.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="347"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) To: 54591@debbugs.gnu.org Cancel-Lock: sha1:lfhhBYxomqWX0pPzWjQBotzayi0= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 02 08:36:22 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1naXN0-000AYW-6M for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Apr 2022 08:36:22 +0200 Original-Received: from localhost ([::1]:47310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1naXMy-0007lj-PK for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Apr 2022 02:36:20 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59564) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naXLi-0007lO-JE for bug-gnu-emacs@gnu.org; Sat, 02 Apr 2022 02:35:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50558) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1naXLi-00085c-9y for bug-gnu-emacs@gnu.org; Sat, 02 Apr 2022 02:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1naXLi-0006gN-50 for bug-gnu-emacs@gnu.org; Sat, 02 Apr 2022 02:35:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Johannes =?UTF-8?Q?Gr=C3=B8dem?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Apr 2022 06:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54591 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.164888125625630 (code B ref -1); Sat, 02 Apr 2022 06:35:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Apr 2022 06:34:16 +0000 Original-Received: from localhost ([127.0.0.1]:44455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naXKy-0006fK-3I for submit@debbugs.gnu.org; Sat, 02 Apr 2022 02:34:16 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:34816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naXKv-0006fC-W8 for submit@debbugs.gnu.org; Sat, 02 Apr 2022 02:34:14 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naXKm-0007iS-Il for bug-gnu-emacs@gnu.org; Sat, 02 Apr 2022 02:34:13 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:48420) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naXKk-00080i-SO for bug-gnu-emacs@gnu.org; Sat, 02 Apr 2022 02:34:04 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1naXKi-0007Sf-3C for bug-gnu-emacs@gnu.org; Sat, 02 Apr 2022 08:34:00 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:229254 Archived-At: Eli Zaretskii writes: > This would be leaving the responsibility for the issue to the caller, > I think. I think that makes sense. > 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. SQLite documentation says this... TEXT. The value is a text string, stored using the database encoding (UTF-8, UTF-16BE or UTF-16LE). ...but it's still possible to store byte sequences that are not legal Unicode in there. This breaks the mentioned Python SQLite3 API, and possibly others, so maybe not great if someone wants to read tables from something else than Emacs. Python-SQLite3 will attempt to decode it as UTF8 unless cast as a blob: SELECT CAST(bad_text AS blob) FROM foo (It works with the sqlite3 CLI, though.) >> 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. Sorry, just my lack of knowledge of Emacs types. Unibyte strings seem fine for this.