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#51716: 29.0.50; [PATCH] Expose xwidget navigation history to Lisp code Date: Sun, 14 Nov 2021 08:53:44 +0200 Message-ID: <83fsrzw7lz.fsf@gnu.org> References: <871r3p8r05.fsf.ref@yahoo.com> <871r3p8r05.fsf@yahoo.com> <83o86s2ft8.fsf@gnu.org> <874k8j33mw.fsf@yahoo.com> <83czn4xfnu.fsf@gnu.org> <87pmr3mvxc.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27403"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51716@debbugs.gnu.org To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 14 07:55:17 2021 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 1mm9Q2-0006tJ-VG for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Nov 2021 07:55:15 +0100 Original-Received: from localhost ([::1]:35346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mm9Q1-00081H-Iz for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Nov 2021 01:55:13 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:48334) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mm9Pq-000819-5o for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2021 01:55:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37398) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mm9Pp-0001H5-TB for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2021 01:55:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mm9Pp-0002zl-Rd for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2021 01:55:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Nov 2021 06:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51716 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 51716-submit@debbugs.gnu.org id=B51716.163687284411430 (code B ref 51716); Sun, 14 Nov 2021 06:55:01 +0000 Original-Received: (at 51716) by debbugs.gnu.org; 14 Nov 2021 06:54:04 +0000 Original-Received: from localhost ([127.0.0.1]:48944 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mm9Ou-0002yI-4W for submit@debbugs.gnu.org; Sun, 14 Nov 2021 01:54:04 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47506) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mm9Os-0002xo-So for 51716@debbugs.gnu.org; Sun, 14 Nov 2021 01:54:03 -0500 Original-Received: from [2001:470:142:3::e] (port=44728 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 1mm9On-0001Cp-Jz; Sun, 14 Nov 2021 01:53:57 -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=N/YrF1tbCEpV9iplB2u8r/OsV3rq21jSHDvEyibuWNI=; b=V5lZrYKeAm4u 19jRo9pHttfWXkNj3UhKaDEBMVOhCvVcfWuOt8a/VpGrKFnDQ1CwNOBTSVeAL6CzgbdbV6+ZTxj90 ly3I8yUjB53lzTYoqtFFtKA24FiYA7VlqoxYo/T8I+jupPYoqhoTDInlVr6AC64GaFi5MwRtg4lOu mM3xSV4cPGn5UWDRhcmi9aEpbYIrlUNKY741JvVYRKQDWNXbtXZ/yT0OE7xZYd7twKbH7exYxAO8K uoHtY5mHo4jEDykrxp8Hj8PKOyL6JHj/oYduWLygAwqolDBnPzq1hqqyohEIp2rSWRhL4bg+BiMib WW/0qXtObHMgZ0ttQWsz2g==; Original-Received: from [87.69.77.57] (port=3245 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 1mm9On-00034v-6r; Sun, 14 Nov 2021 01:53:57 -0500 In-Reply-To: <87pmr3mvxc.fsf@yahoo.com> (message from Po Lu on Sun, 14 Nov 2021 08:18:39 +0800) 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:219889 Archived-At: > From: Po Lu > Cc: 51716@debbugs.gnu.org > Date: Sun, 14 Nov 2021 08:18:39 +0800 > > Eli Zaretskii writes: > > > Sorry, I don't understand: the above produces strings that will be > > used by Emacs Lisp. So UTF-8 is not relevant; the question is whether > > the string that comes from WebKitGTK can include non-ASCII characters. > > If it can, we need to decode it, e.g. by decode_string_utf_8 (can > > these strings include byte sequences that aren't valid UTF-8?). > > Ah, they cannot include byte sequences that aren't valid UTF-8. If they cannot include invalid UTF-8, then using decode_string_utf_8 is what you need to do. You cannot use those strings directly in Lisp, because they will be unibyte strings. IOW, using build_string there is incorrect, you need to use make_unibyte_string and decode_string_utf_8 instead. build_string is correct only for plain-ASCII strings.