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: Mon, 13 Dec 2021 14:49:03 +0200 Message-ID: <83mtl4n000.fsf@gnu.org> References: <87tufmjyai.fsf@gnus.org> <87sfv5ljxn.fsf@gnus.org> <8735n5leza.fsf@gnus.org> <837dch1qox.fsf@gnu.org> <87ee6odu65.fsf@gnus.org> <83h7bjye0b.fsf@gnu.org> <87sfv360np.fsf@gnus.org> <83lf0vw6sg.fsf@gnu.org> <87k0gd1cl3.fsf@gnus.org> <83zgp8svkw.fsf@gnu.org> <83ilvvqwu8.fsf@gnu.org> <87bl1mihb7.fsf@gnus.org> <83k0gapacz.fsf@gnu.org> <874k7ee01l.fsf@gnus.org> <838rwqp4x7.fsf@gnu.org> <87o85mchkg.fsf@gnus.org> <87k0gacgl7.fsf@gnus.org> <834k7ep26q.fsf@gnu.org> <871r2htahx.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20791"; 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 Mon Dec 13 13:50:38 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 1mwkmr-0005F7-Di for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Dec 2021 13:50:37 +0100 Original-Received: from localhost ([::1]:55478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwkmp-0001IB-MK for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Dec 2021 07:50:35 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwklR-0000bJ-Br for emacs-devel@gnu.org; Mon, 13 Dec 2021 07:49:09 -0500 Original-Received: from [2001:470:142:3::e] (port=57594 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 1mwklR-0000MU-2C; Mon, 13 Dec 2021 07:49:09 -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=zLQYjm+ZqSpJYO0jN1Tcc7QktbNwAxT97noByhGndys=; b=mB7uL1ccO/xm V8n7TaINkfBdXMLX6V6iHf4xJiBn8SlNaEjI7SdctUyRfEs2L/G+tJ+zUbvVlZGcztDm2ajkljJSY XhZMnrYS6UbOSjTMf47PaGiQDq+QUmFSKIqlywBe0G9TZ3TIb0rnm3YcNzRVLLI7EuTjH8FNenzwD HI9NILhYxqcD7vcwlgCyTx1o6ppnTnVz7mO3ChflGLzR35yjhC8bG7xU2V9GuYoeS0MzJEKKfKwZf TB7IzK8RfMaonDomXfarw3iuxfp1C4w+ozftdc0aVnyMima4re5pCaWgdxlNx186D6PJWAdu/mY0j wkqGwX7z1kym3tx29yvAKA==; Original-Received: from [87.69.77.57] (port=2051 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 1mwklQ-0002IT-9r; Mon, 13 Dec 2021 07:49:09 -0500 In-Reply-To: <871r2htahx.fsf@gnus.org> (message from Lars Ingebrigtsen on Mon, 13 Dec 2021 05:05:46 +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:281841 Archived-At: > From: Lars Ingebrigtsen > Cc: emacs-devel@gnu.org > Date: Mon, 13 Dec 2021 05:05:46 +0100 > > Eli Zaretskii writes: > > > The documentation says so, yes. But I looked inside the sqlite3 > > source, and I'm now confused: it seems like the Unix code path there > > just uses the file name passed to the library without any checks or > > changes? The Windows code does convert from UTF-8 to the wchar_t > > (a.k.a. UTF-16) encoding that is native to Windows. > > > > So it sounds like we should use ENCODE_FILE after all? > > ENCODE_FILE on everything but Windows, but encode as utf-8 on Windows, it > sounds like? Pretty confusing interface. ENCODE_FILE already uses UTF-8 on MS-Windows, so there's no problem. The answers to my question mostly miss the point, but my take from them is that indeed the UTF-8 requirement for file names is only relevant for MS-Windows, whereas on Posix hosts sqlite3 just uses the byte sequence we hand to it. You can see the answers here: https://sqlite.org/forum/forumpost/02798ac965 So I'll be changing the couple of places where we pass file names to sqlite3 to use ENCODE_FILE.