From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id aJX6Fn3D82OSSgEAbAwnHQ (envelope-from ) for ; Mon, 20 Feb 2023 20:01:17 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id YH/wFn3D82MKVQEA9RJhRA (envelope-from ) for ; Mon, 20 Feb 2023 20:01:17 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 05CEF16270 for ; Mon, 20 Feb 2023 20:01:16 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUBOs-0007J9-6l; Mon, 20 Feb 2023 14:00:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUBOq-0007Bw-2l for emacs-orgmode@gnu.org; Mon, 20 Feb 2023 14:00:32 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUBOo-0008AG-Ac for emacs-orgmode@gnu.org; Mon, 20 Feb 2023 14:00:31 -0500 Received: by mail-wm1-x331.google.com with SMTP id az11-20020a05600c600b00b003dc4fd6e61dso1833220wmb.5 for ; Mon, 20 Feb 2023 11:00:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:date:references:in-reply-to:subject:cc:to:from :message-id:from:to:cc:subject:date:message-id:reply-to; bh=D4be+v7LNTA4L/zus4evJ+vaqD+BmYdXdfCgnsWsjzM=; b=hPgMXIVBKM80DlMIT4P72iUm5p4m2Zj8szxi/fwgEoQl5ouFIeg6GiNjZ6mLJLBv2K 3u9+E08WJfpb/0c3unqCsTqzIiCg4iOf0k1wfrZR/IgYzj5lxDITiGQrN2blN4ljrvmO FnEmebrzX6rDNAoI8vcUe16ucRzJFwFWnUFSVuSpyxPi5LVc6rlViwzxcTLMGBuxtVrm Q7ZFpg/8fgaPU4xZ1cQSKYhTtSM0lnqUe9Ls/T0tCfj+FkN1a0956ZYAMBJ+ei0x3PcM Ow0GMBYMSa2JgSG4Pk821sz8RaM1ysnd1dqwxI9kT3suPRZVeSKDOb6h0Q+cXeIMXVwq E3gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:date:references:in-reply-to:subject:cc:to:from :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=D4be+v7LNTA4L/zus4evJ+vaqD+BmYdXdfCgnsWsjzM=; b=ACPbIiVk2i21kw7f+t8vXMSjfCaJg5iWr3VjTpDndMRzv3twO0fjyOap4u/xmV8iDR oSEFt1arub3qtIeU8SYhQFx31XXmhh8x7Wrr+hHJxYl8xChFAK9OsPDy22AWPjnlOMIQ 221DWtdXaGzhFv1wbNLsENx/+F5NEmiOeaSRKo5BgpQFDB5mh1gk0XuJVJSXRu7Bmhco vWccLs1I2SxV37WstEKqStGJg4tbH8JkT5x8DKvdOE1aV+cOAESTWmP5Dnkg54wJR+Ub 4ufU8H8iNohOmUh3+oEY6eUUCZNCOLuKIyWgmQbhjCW15yk9A6UJTmLlV/yneesOob6t nDXw== X-Gm-Message-State: AO0yUKUn0u6jw9zgNLSMg3lItATr5orTMeP/FULFezyEqq0ODux23zd0 BqH+hOYBQG0lkm8YC0Xnc48= X-Google-Smtp-Source: AK7set8Oah4ZFPcchIoH9eL4TemkcVtWw6MfKnHzLOH2GtU49cJToCJZ7TdGq1YGWCVwASrgW/pjxw== X-Received: by 2002:a05:600c:3b20:b0:3df:db20:b0ae with SMTP id m32-20020a05600c3b2000b003dfdb20b0aemr1465915wms.17.1676919628460; Mon, 20 Feb 2023 11:00:28 -0800 (PST) Received: from keynux ([2a01:e0a:505:3460:169:7511:f49a:58eb]) by smtp.gmail.com with ESMTPSA id p8-20020a1c7408000000b003b47b80cec3sm1055268wmc.42.2023.02.20.11.00.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 11:00:27 -0800 (PST) Message-ID: <63f3c34b.1c0a0220.56de7.422e@mx.google.com> Received: by keynux (sSMTP sendmail emulation); Mon, 20 Feb 2023 20:00:24 +0100 From: Bruno Barbier To: Jens Lechtenboerger Cc: Ihor Radchenko , emacs-orgmode@gnu.org Subject: Re: Unicode problem with export of literal contents In-Reply-To: <87sff0skuf.fsf@wi.uni-muenster.de> References: <87zg9dx4yl.fsf@wi.uni-muenster.de> <87cz68d06x.fsf@localhost> <87sff4nscd.fsf@wi.uni-muenster.de> <63efb80e.7b0a0220.bb35b.4ae2@mx.google.com> <87cz64u232.fsf@wi.uni-muenster.de> <63f3402a.050a0220.48628.9248@mx.google.com> <87sff0skuf.fsf@wi.uni-muenster.de> Date: Mon, 20 Feb 2023 20:00:24 +0100 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=brubar.cs@gmail.com; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=hPgMXIVB; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1676919677; a=rsa-sha256; cv=none; b=js4OeUEnSUgCF23q85u5cNab62zzgwarR4o8RnkVwcSuO/40A922I5C37+ComfzSk9q3HZ +BTHr3PUkwqDhieHSNtcaX6FnPwNPimYdvwM9B3N+bceWqTYIEt8nJiMlzGctKpMXzhsCp kt6/zhYyRdpiQiMGsJL/DM30VEARwKedq12B71oenrrS1D//e3H5QPeXDQecq/V+K1uydy 0K9TM5bXBEUeY15Bi2j8qUenTNCfyTQv8Aro3yFbUX4eHZr4j0GjmpUzy/nY9rAJJK21x0 oxroQ2C7XWZ+wNNUN5u1PtU9YKOzSufQZZY14ZUjF9iOwlJxDGCkrmBfhgIWFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676919677; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=D4be+v7LNTA4L/zus4evJ+vaqD+BmYdXdfCgnsWsjzM=; b=fp7V/z7X3ZW1CoUXJgU5IFXYT4uu9F/OPrrWcYscrvbpTcHKMUjTXq3Hw3IBO/O78bPckm tz5zsaqlpfBtHIFDEJbgCXSjJnAbncMg9CU22RaKowjAivLovx5ztLhBVEIX+KS1acDxqF 03+kAB2fcjsrjXviVrjFLdxOyOVBxXa1vrVgncZq5OoBaZQyFLk8aNZ0FrRb2bFwrmtngB tfriOV2S1zJBBItDdk8aXFcpRKZq2hIU8CRm00rgoLGfQ8OEtws2CvE2mefTX8nKwEfSNU eNn5jX1G59fUMk1VYNENMfYejQX66HRn0e/Jkt0tUQOk4yA2n/kxmmtemb/aQw== X-Spam-Score: -5.61 X-Migadu-Queue-Id: 05CEF16270 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=hPgMXIVB; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com X-Migadu-Spam-Score: -5.61 X-TUID: IACa64fJzdM0 Jens Lechtenboerger writes: > On 2023-02-20, Bruno Barbier wrote: > > However, if I use insert-file-contents-literally with a unicode > file, I do *not* have to set the coding-system-for-write. This just > works: > > (with-temp-buffer > (insert-file-contents-literally "~/unicode.org") > (secure-hash 'md5 (current-buffer))) Humm. Emacs is amazing: it managed to guess the right encoding, from the buffer context, probably... But, what you are giving to 'org-export-string-as' is not the buffer, it's a string. So, let's try the same without using an org function: (with-temp-buffer (insert (with-temp-buffer (insert-file-contents-literally "~/unicode.org") (buffer-string))) (secure-hash 'md5 (current-buffer))) And, that fails, requesting an encoding. > In the context of Org export, secure-hash seems to require a coding > system. Why? I'm not an expert, so, you'll need to confirm with other sources. But secure-hash requires an encoding in all cases, to compute the hash of some text, because it needs the array of bytes that represents that text to compute its hash. I don't see any bug in org, and, I don't see any bug in secure-hash either. You literally shoud stop using "literally" ;-) And, you might want to read: (info "(elisp) Non-ASCII Characters") Bruno > > Best wishes > Jens