From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string Date: Sat, 02 Apr 2022 08:31:52 +0300 Message-ID: <83r16g3vav.fsf@gnu.org> References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> <87a6d672xr.fsf@gnus.org> <878rso7iuu.fsf@flokut.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35367"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 54591@debbugs.gnu.org To: Johannes =?UTF-8?Q?Gr=C3=B8dem?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 02 07:32:35 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 1naWNG-00092U-UB for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Apr 2022 07:32:35 +0200 Original-Received: from localhost ([::1]:39830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1naWNF-0006lW-Ig for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Apr 2022 01:32:33 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naWMo-0006lO-L7 for bug-gnu-emacs@gnu.org; Sat, 02 Apr 2022 01:32:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50477) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1naWMk-0007Ad-Gv for bug-gnu-emacs@gnu.org; Sat, 02 Apr 2022 01:32:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1naWMk-00055m-AH for bug-gnu-emacs@gnu.org; Sat, 02 Apr 2022 01:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Apr 2022 05:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54591 X-GNU-PR-Package: emacs Original-Received: via spool by 54591-submit@debbugs.gnu.org id=B54591.164887750619548 (code B ref 54591); Sat, 02 Apr 2022 05:32:02 +0000 Original-Received: (at 54591) by debbugs.gnu.org; 2 Apr 2022 05:31:46 +0000 Original-Received: from localhost ([127.0.0.1]:44373 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naWMT-00055E-Pv for submit@debbugs.gnu.org; Sat, 02 Apr 2022 01:31:45 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58380) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naWMS-000551-39 for 54591@debbugs.gnu.org; Sat, 02 Apr 2022 01:31:44 -0400 Original-Received: from [2001:470:142:3::e] (port=37516 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naWMM-00073j-8r; Sat, 02 Apr 2022 01:31:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=yevGowRo4oITWSvkMgPv+RlDCq4gHldBezBIvOQ6hCg=; b=mApzmKCpVrh8gNoIzmWf h+Xt0n1/689tXBkgTwcCbC1QojD90f7B5NehLu+vj1kiToKhY9uQIvTjN4wf+VLnc0Jl9ZGfxpvMh /z4jBUcySITjPFEsTi6uUbEjBRW7mVvGYT3aIU9a4C+7YGIXPEru+CatK3MOsTz5LlA71lfIbFvdD quQZtR00XUHaXvwbjqY2oVKv8574OzhNnoEcB4KZScA5hvAs7/KbNqAavwvps7W1c3KigtG+BwaY/ 3UoUXFxD6Gk48+SfVcZnXHCNHGeaZxOYXXMKGj6FMY53nOICsohDQB2H0RXEcGBNgndl/vYviGy9c 7yKxez+TxUdmwQ==; Original-Received: from [87.69.77.57] (port=2873 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naWML-0002lq-9O; Sat, 02 Apr 2022 01:31:37 -0400 In-Reply-To: <878rso7iuu.fsf@flokut.localdomain> (message from Johannes =?UTF-8?Q?Gr=C3=B8dem?= on Fri, 01 Apr 2022 20:34:49 +0200) 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:229253 Archived-At: > From: Johannes Grødem > 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.