From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ernest =?iso-8859-1?Q?Adrogu=E9?= Newsgroups: gmane.emacs.help Subject: Re: python-shell-send-region uses wrong encoding? Date: Tue, 29 Oct 2013 18:53:03 +0100 Message-ID: <20131029175303.GA29272@doriath.local> References: <20131029113044.GA28039@doriath.local> <526FC58A.6080204@easy-emacs.de> <20131029145554.GB28671@doriath.local> <20131029163426.GA29055@doriath.local> <83ppqodmnc.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1383069219 13601 80.91.229.3 (29 Oct 2013 17:53:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Oct 2013 17:53:39 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 29 18:53:42 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VbDU4-0005Ai-Qa for geh-help-gnu-emacs@m.gmane.org; Tue, 29 Oct 2013 18:53:40 +0100 Original-Received: from localhost ([::1]:48639 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbDU4-00040o-EO for geh-help-gnu-emacs@m.gmane.org; Tue, 29 Oct 2013 13:53:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbDTk-0003zh-Pi for help-gnu-emacs@gnu.org; Tue, 29 Oct 2013 13:53:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbDTc-0004ox-47 for help-gnu-emacs@gnu.org; Tue, 29 Oct 2013 13:53:20 -0400 Original-Received: from mail-wi0-x233.google.com ([2a00:1450:400c:c05::233]:43957) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbDTb-0004oV-SN for help-gnu-emacs@gnu.org; Tue, 29 Oct 2013 13:53:12 -0400 Original-Received: by mail-wi0-f179.google.com with SMTP id hm4so245702wib.0 for ; Tue, 29 Oct 2013 10:53:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=dsRLSMfW3xhFCq4mUB3Py7+FkQmyQJ244UMESIk0NbI=; b=kvrAClechTRfT+qs+sjfXH/AFa2EmyREGNKUiiw9cAEPQgEin0HUyi/xU3Hew7ih95 EqgAA85WdAVNKbvB2sCmp4AgR/ZNiIGMZR4ujpyAw9c2rvttTPXu8Mb+NhMZyiM+r5oP 2sDc5XxEtyX6tkRXUhXESVc7QfJlSP/lJVMN63EYGf780AXRV43qbjAbZf6QeslKQZB7 IjJtma6XOlypiyPh1/eqKZ1gkVWY/EU3VgVrWJzayX2z6mld+DygRnn3w8FtR24oxoUf ksEKzvdLbK4kaqWSs3bki895Ywr8y2nZ61cPytwtH+yCFgz3hq1RzGkt0IeBBnBE6wDV l/Ng== X-Received: by 10.180.188.164 with SMTP id gb4mr13898409wic.52.1383069190762; Tue, 29 Oct 2013 10:53:10 -0700 (PDT) Original-Received: from doriath (200.Red-83-58-146.dynamicIP.rima-tde.net. [83.58.146.200]) by mx.google.com with ESMTPSA id d11sm7141763wic.4.2013.10.29.10.53.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Oct 2013 10:53:09 -0700 (PDT) Content-Disposition: inline In-Reply-To: <83ppqodmnc.fsf@gnu.org> X-Operating-System: GNU/Linux (Debian jessie/sid) User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::233 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:94256 Archived-At: 29-10-2013, 19:15 (+0200); Eli Zaretskii escriu: > > Date: Tue, 29 Oct 2013 17:34:26 +0100 > > From: Ernest Adrogu=E9 > >=20 > > The "=F6" character is stored in the file as 0xC3 0xB6. As you say, thi= s is > > the UTF-8 encoding for this character. > >=20 > > The Python interpreter interprets the 2-byte sequence correctly. This = can > > be seen in a number of ways: if I run the script in a terminal, or if I > > paste or yank the line into Python shell buffer, or I do > > python-shell-send-buffer, in all these cases the sequence is converted = into > > 0xF6, which is the UTF-16 encoding for "=F6" that Python uses internall= y, as > > the output from repr() shows.. > >=20 > > However, when the bytes are sent with python-shell-send-region, the > > interpeter thinks that 0xC3 0xB6 are 2 characters, which is wrong. In = light > > of this, I would say that there is a bug in python-shell-send-region. >=20 > Why is that a bug, and what would you expect python-shell-send-region > to send instead (and why)? I would expect python-shell-send-region to be a shortcut for saving the region, switching to the shell buffer, yanking and hitting RET.