Eli Zaretskii <eliz@HIDDEN>
to control <at> debbugs.gnu.org.
Full text available.Received: (at submit) by debbugs.gnu.org; 8 Dec 2025 14:19:36 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 08 09:19:36 2025 Received: from localhost ([127.0.0.1]:45689 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1vSc5P-0001Rc-P3 for submit <at> debbugs.gnu.org; Mon, 08 Dec 2025 09:19:36 -0500 Received: from lists.gnu.org ([2001:470:142::17]:35660) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <rpluim@HIDDEN>) id 1vSc5M-0001R6-Ns for submit <at> debbugs.gnu.org; Mon, 08 Dec 2025 09:19:33 -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 <rpluim@HIDDEN>) id 1vSc59-0003Gg-R9 for bug-gnu-emacs@HIDDEN; Mon, 08 Dec 2025 09:19:20 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <rpluim@HIDDEN>) id 1vSc57-0005sI-Tr for bug-gnu-emacs@HIDDEN; Mon, 08 Dec 2025 09:19:19 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-42e2e77f519so2882926f8f.2 for <bug-gnu-emacs@HIDDEN>; Mon, 08 Dec 2025 06:19:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765203555; x=1765808355; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=QU7umtdQSicDpxF7SVZNvKZzvLezzog1OZI7yZZ6X2Y=; b=l8P63rG25j25T1HY/MZnBCHBIE27fXi7koESq2A0DSCszIJAeFS+l0dlsH8+gfUl6h biIa3EtYuHBYpHK/xvePTHijmrIfHAVy7ympHQFKwhoAIBqFDOLXfn2IQS/FYXw064Et +EiA0AQK+MRwNNBomQGmxYgQuH8a+uhDSerjAsXfm+M9VCnWfNqNvKqJnE2G9hI0Is55 D7b0y7WIt0eCJSGrQpIj7dN76/3AEpO9R8LPsCbv7zX3eFtbikN25YGNDz+pI/NumGlk gktDea0erbSEsSPfuoS2HI/3VN3ERLWDUoLeK1qCbVf4kzw7ZwECwPviC+an6cgWv7MO 7OlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765203555; x=1765808355; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=QU7umtdQSicDpxF7SVZNvKZzvLezzog1OZI7yZZ6X2Y=; b=g3e96oN5v7eYuz/Wy7sM8XrHt76t8wapVti4ob9PfLofud+Tr98mmcFoFQI6MIaeJ2 tCeo5Gqd+gjbh2ZapNiFmW7VtnH0C+Kutn63u1k/iXi0okoE8oPgR9FKPQtvgsgoYXo4 rYVXVXDjX4BAg/WMsCJG4whZBLorQhLQ+/CfzuliwzB+u7Rlv1XSWGD2/X9QpQWS2rqr 6ZvyCCjQd5I84tDCusod26CvhxG/UyZ86CpGsm/94NTQCh0HwGf82FGhqM6u4CBlOFJI PVZP0Y+Jq3aLtMxYSv6n70/JTJAmZ9TQkCN+plLHhP/W+hsuReBct4KnRon8sFHrYE8M zn8Q== X-Gm-Message-State: AOJu0YwogAzhOEZbeLbPp6Ceo/kCp5C2MCsswCqniw7iGCEwjaJGOOnK zFjLL54wPMA7z8tXXseylSZMzLwbGFEUd7CnAG8EN8Daa4HPfcuoKgyO X-Gm-Gg: ASbGncsSjvziQBvwvLRqMZBZ/P2QYuQJO+lAUi2uHkiEMl4sDqw590P4tyFNIi18RzG /VgnkIxny24LKrU6eN2w8FaWKqjnGOVaMYp8HT1UnJyx2kHV4bJ4hEaK8BLXLMVfoyYzHxBjhe+ NTxr85L15iiI521caGRvJ0atl4Uq57XaNSi9OX21dhmnFi/O0P4YPGulU7b86j5UsIuGfkqwp12 mRVoGb1YMhHS/NJlyJ+ITKE/6MHm/4cc8uXK/Al8oO3VuVwIkLDZ3+hTcnbrbtLrsWHsPpNgmmi P6eVyJ8l690OSjdgqGrwyQQsw4t68hBCvaDrbiLIv5W5eSW2kNdYIuStIOiGhCLAeW3213vQvNe mDfLIr8SSlY8WiulMsTD8iQ3KbZK8UZzPPCPUYtVdS50tF5j2tU4ljB2v06giJPYmMWbTH+KkLg == X-Google-Smtp-Source: AGHT+IEc+D8F6Jbpj7hhee1CjLEpc1p+XOIeXTcrMJ8jpkshghTZ/KWEB12FqC8e/Q28JBWmkL7jxA== X-Received: by 2002:a05:6000:186c:b0:42b:2f59:6044 with SMTP id ffacd0b85a97d-42f89f0c762mr8218299f8f.17.1765203555233; Mon, 08 Dec 2025 06:19:15 -0800 (PST) Received: from rlsb ([2a01:e0a:3f3:fb50:5234:8d9b:abea:a9f3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42f7d353be1sm25139343f8f.39.2025.12.08.06.19.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Dec 2025 06:19:14 -0800 (PST) From: Robert Pluim <rpluim@HIDDEN> To: bug-gnu-emacs@HIDDEN Subject: 31.0.50; iso-8859-1 usage by selection code under Wayland X-Debbugs-No-Ack: yes X-Debbugs-Cc: Date: Mon, 08 Dec 2025 15:19:14 +0100 Message-ID: <87v7ihjbtp.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=rpluim@HIDDEN; helo=mail-wr1-x42f.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, 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-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: Po Lu <luangruo@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.0 (/) This is a pgtk build of master, running under Wayland, no XWayland is involved. This arose from <https://emacs.stackexchange.com/questions/85255/encoding-issue-with-pgtk-b= uild-on-wayland-umlauts-dont-reach-chromium/85276#85276> Chromium is requesting the contents of the clipboard using the 'TEXT type. The buffer and the clipboard contain "=C3=AB". Emacs ends up in `xselect--encode-string', where it decides to use 'iso-8859-1' to encode the string, which Chromium then does not understand, and we get mojibake. Forcing `xselect--encode-string' to use 'utf-8 for 'TEXT results in Chromium inserting the correct text, but I don=CA=BCt know if that is the correct fix. Wayland appears to assume utf-8 for text, but I=CA=BCve failed in finding a definitive reference for that. (based on its docstring, setting `selection-coding-system' to 'utf-8 should have fixed it, but that=CA=BCs ignored, since (coding-system-type 'utf-8) is not 'charset.) The following patch fixes it for me, but comments from someone more knowledgeable are welcome. It=CA=BCs possible it will fail horribly when running a pgtk build under X or XWayland, but I=CA=BCve decided not to think about that. diff --git a/lisp/select.el b/lisp/select.el index 59eedc79263..59fd0650ba5 100644 --- a/lisp/select.el +++ b/lisp/select.el @@ -598,7 +598,8 @@ xselect--encode-string ;; (see ns_string_to_pasteboard_internal in nsselect.m). (when (eq type 'TEXT) (cond - ((featurep 'ns) + ((or (featurep 'ns) + (featurep 'pgtk)) (setq type 'UTF8_STRING)) ((not (multibyte-string-p str)) (setq type 'C_STRING)) In GNU Emacs 31.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 3.24.49, cairo version 1.18.4) of 2025-12-02 built on rlsb Repository revision: f762ce48d56534f3130470ebae7e276f707d51aa Repository branch: master System Description: Debian GNU/Linux 13 (trixie) Configured using: 'configure --with-pgtk' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB Robert --=20
bug-gnu-emacs@HIDDEN:bug#79966; Package emacs.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.