From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: David Malcolm Newsgroups: gmane.emacs.bugs Subject: bug#25987: 25.2; support gcc fixit notes Date: Wed, 11 Nov 2020 14:36:49 -0500 Message-ID: References: <87lgsj1jle.fsf@tromey.com> <1521218887.2913.237.camel@redhat.com> <83muz7pyde.fsf@gnu.org> <83o8lf9p68.fsf@gnu.org> <26f277bb345f10efe6340ac4074960905064fc97.camel@redhat.com> <83362i2nul.fsf@gnu.org> <8666386379d22239075d9237f00f40469c5be454.camel@redhat.com> <837drkopuf.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30766"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.36.5 (3.36.5-1.fc32) Cc: 25987@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 11 20:37:22 2020 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 1kcvvm-0007ry-In for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 Nov 2020 20:37:22 +0100 Original-Received: from localhost ([::1]:45404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcvvl-0001Iv-Hu for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 Nov 2020 14:37:21 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcvvS-00015x-Nn for bug-gnu-emacs@gnu.org; Wed, 11 Nov 2020 14:37:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59593) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kcvvS-0003el-EU for bug-gnu-emacs@gnu.org; Wed, 11 Nov 2020 14:37:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kcvvS-0007GF-At for bug-gnu-emacs@gnu.org; Wed, 11 Nov 2020 14:37:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: David Malcolm Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Nov 2020 19:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25987 X-GNU-PR-Package: emacs Original-Received: via spool by 25987-submit@debbugs.gnu.org id=B25987.160512341827900 (code B ref 25987); Wed, 11 Nov 2020 19:37:02 +0000 Original-Received: (at 25987) by debbugs.gnu.org; 11 Nov 2020 19:36:58 +0000 Original-Received: from localhost ([127.0.0.1]:42906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcvvO-0007Fw-1U for submit@debbugs.gnu.org; Wed, 11 Nov 2020 14:36:58 -0500 Original-Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44233) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcvvL-0007Fn-SQ for 25987@debbugs.gnu.org; Wed, 11 Nov 2020 14:36:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605123415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tuZMKWiUDAcxTPoFkuQRWue6/VxLyaLtFv4v8MblFZA=; b=WdbCHPnRA1QO16vDTX9WW9MpAjZgt/cJl7auow0zTfbBVOoZT4xRn3um3779VnDmnZvk20 gWB3gXjz9fL/kGzeYNEZbOpdZie71oxxTnEN0OFu2f3T/ORdMtxt6wM2LxgTzo+M2UABli vL5fc1Kn/HfYxS5UXvwpSiAoWjqBBuw= Original-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-483-0kB7baU8OUiP_mR4poWbLw-1; Wed, 11 Nov 2020 14:36:51 -0500 X-MC-Unique: 0kB7baU8OUiP_mR4poWbLw-1 Original-Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7006E5F9C2; Wed, 11 Nov 2020 19:36:50 +0000 (UTC) Original-Received: from ovpn-112-135.phx2.redhat.com (ovpn-112-135.phx2.redhat.com [10.3.112.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0B4C75C629; Wed, 11 Nov 2020 19:36:49 +0000 (UTC) In-Reply-To: <837drkopuf.fsf@gnu.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmalcolm@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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:193133 Archived-At: On Tue, 2020-10-20 at 18:54 +0300, Eli Zaretskii wrote: > > From: David Malcolm > > Cc: 25987@debbugs.gnu.org > > Date: Tue, 20 Oct 2020 10:52:05 -0400 > > > > One possible issue: in the final diagnostic, there's a fix-it hint > > with > > non-ASCII replacement text, replacing "two_pi" with "two_π" (where > > the > > final char in the latter is GREEK SMALL LETTER PI, U+03C0) > > > > This replacement currently expressed as encoded bytes i.e: > > > > fix-it:"demo.c":{51:10-51:16}:"two_\317\200" > > > > where \317\200 is the octal-escaped representation of the two bytes > > of > > the UTF-8 encoding of the character. > > > > Is this going to work for Emacs? > > You mean, GCC doesn't actually emit the UTF-8 encoding of π, it emits > its ASCII-fied representation? We'd need to decode that, but is that > really justified? Why not emit UTF-8? I have an implementation that simply emits UTF-8 in quotes, escaping backslash, tab, newline, and doublequotes as before. (we have to escape at least newline, given that fix-it hint replacement text can contain them, and we're using newline to terminate the parseable hint). However, the filename also needs to be escaped. Currently I'm applying the same escaping rules to both filename and replacement text. What is the encoding of the filename? What if the bytes in a filename aren't UTF-8 encoded? How does emacs handle this case? I tried creating file with the name "byte 0xff" .txt, and with valid UTF-8 non- ascii names and emacs reported them as \377.txt and with the UTF-8 names respectively, so perhaps I should simply emit the bytes and pretend they are UTF-8? Dave [1] https://dwheeler.com/essays/fixing-unix-linux-filenames.html