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.devel Subject: Re: sqlite3 Date: Tue, 07 Dec 2021 05:23:54 +0200 Message-ID: <83sfv5yu5x.fsf@gnu.org> References: <87tufmjyai.fsf@gnus.org> <87sfv5ljxn.fsf@gnus.org> <8735n5leza.fsf@gnus.org> <835ys11pxy.fsf@gnu.org> <87pmq9jyv1.fsf@gnus.org> <831r2p1or2.fsf@gnu.org> <87czm9jxjd.fsf@gnus.org> <83tuflzdc3.fsf@gnu.org> <878rwxjwt8.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22300"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 07 04:24:58 2021 Return-path: Envelope-to: ged-emacs-devel@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 1muR6A-0005f7-83 for ged-emacs-devel@m.gmane-mx.org; Tue, 07 Dec 2021 04:24:58 +0100 Original-Received: from localhost ([::1]:36978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muR68-0008FY-Un for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Dec 2021 22:24:56 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muR59-0007ZV-8I for emacs-devel@gnu.org; Mon, 06 Dec 2021 22:23:55 -0500 Original-Received: from [2001:470:142:3::e] (port=52880 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 1muR58-0004m3-NA; Mon, 06 Dec 2021 22:23:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=T0FgZd7t8uTNL8ZbeH2AnqExBbk/ZaUdyaTq5DZqkKg=; b=MsgiLaXugcU6 kROyEvOG9oimCxbW6BTKX19yTMFsT14Wuh54KZNh0Cfr/PLxWjPShDfl6GciELpno46Z00VE5wPIx EK8IWaiX89Roqf83a+rYuTIXkZ0DKoHvsA1Milf7jwIk3aZeAfliByzlwXWymqaNiWbcZuEvqOEbb fSrId+lPZcvZdl9qea7RvZawB7DJ8W4McwMN040aGCeF4rw73sXLkuU1XRLBTJTqyKW22MMhvb39I qC59bluYvshbeLkFKLo0lxwXlDmXlzI/f61Vs28SRY0suMFM+FzbBPaBCljcR1eArDzLHw8elAKD0 NPXwodr0qJnmgTwVrULqLQ==; Original-Received: from [87.69.77.57] (port=3754 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 1muR58-0005up-Cn; Mon, 06 Dec 2021 22:23:54 -0500 In-Reply-To: <878rwxjwt8.fsf@gnus.org> (message from Lars Ingebrigtsen on Mon, 06 Dec 2021 21:35:47 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:281193 Archived-At: > From: Lars Ingebrigtsen > Cc: emacs-devel@gnu.org > Date: Mon, 06 Dec 2021 21:35:47 +0100 > > Eli Zaretskii writes: > > >> This function is optimized for speed when the input string is > >> already a valid UTF-8 sequence, i.e. there are neither 8-bit raw > >> bytes nor any UTF-8 sequences longer than 4 bytes in the string's > >> contents. > > > > ??? This says that if the string is a valid UTF-8, the function will > > work very fast, so what's the problem? > > I'm not sure whether what we're getting from sqlite is valid UTF-8. > (This was in the opposite direction; decode_string_utf_8.) But the > other direction should be OK so long as we're checking that it's not a > unibyte >128-char string. Yes, I was talking about the other direction, from Emacs to sqlite, i.e. encoding. For decoding stuff from sqlite to Emacs, I agree that code_convert_string_norecord is the right approach, in case someone put non-UTF-8 bytes in the DB.