From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?= Newsgroups: gmane.emacs.help Subject: Re: python-shell-send-region uses wrong encoding? Date: Wed, 30 Oct 2013 13:45:08 +0100 Message-ID: <5270FF54.7060308@easy-emacs.de> References: <20131029113044.GA28039@doriath.local> <5270AAF3.5040906@easy-emacs.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1383136970 13678 80.91.229.3 (30 Oct 2013 12:42:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Oct 2013 12:42:50 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 30 13:42:54 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 1VbV6s-0007TA-0W for geh-help-gnu-emacs@m.gmane.org; Wed, 30 Oct 2013 13:42:54 +0100 Original-Received: from localhost ([::1]:52199 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbV6r-0005cs-LW for geh-help-gnu-emacs@m.gmane.org; Wed, 30 Oct 2013 08:42:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57441) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbV6c-0005cX-FD for help-gnu-emacs@gnu.org; Wed, 30 Oct 2013 08:42:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbV6W-0002hg-Gl for help-gnu-emacs@gnu.org; Wed, 30 Oct 2013 08:42:38 -0400 Original-Received: from moutng.kundenserver.de ([212.227.17.8]:49455) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbV6W-0002ha-77 for help-gnu-emacs@gnu.org; Wed, 30 Oct 2013 08:42:32 -0400 Original-Received: from purzel.sitgens (brln-4d0c7d89.pool.mediaWays.net [77.12.125.137]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MIh7g-1Vdgxq3Giu-002QRu; Wed, 30 Oct 2013 13:42:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.0 In-Reply-To: X-Provags-ID: V02:K0:DZvvEGOiOO9+9L8d4/006061GdKSNQ7ujzyb3VuJ0n/ 1tYjikofR9Ohz3uHOWXPJiH5/zPyRHvrfmWmGRF/Kwl/ocJMnE J669jbqogf1EQBPpfjuA1FClvxz5tkYkWRa4bfwWHPbWIJCe3G 8yEKVDiC8n8XV4rPhp8dkuc0ctnCt8KtlahtpbLm2cv5oFLr2+ 3WevxQ8/xAplGCZ5yZ/tcpbei7S3RfPQs520tfDKCEChrybe5w AWqYExWM47TLsuYHaTNnydNjSHo+urlM2pvi4em42IfK0D7p/a CaXybCDFS7wgOYKt+j+PiubuD5sHxTuCsD/ZYUAktXD/yoBjkh J+9xmwCeLuxdtDB4gI8CVxWO75ykFxLTcrepcN6Yy X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.17.8 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:94273 Archived-At: Am 30.10.2013 13:08, schrieb Yuri Khan: > On Wed, Oct 30, 2013 at 6:37 PM, Stefan Monnier > wrote: >>> IIUC the second added line "-*- coding: utf-8 -*-\n" should not be needed, >>> as that's the default at the Python side anyway. >> >> Based on the OP's experience, it seems this is not true. >> Also, the doc I can find indicates that the default is ASCII (and was >> latin-1 in the past, which is what the OP seems to be seeing). > > There is Python, and, on the other hand, there is Python. > > In some GNU/Linux distributions (e.g. Ubuntu), the default Python is > version 2.x, whose default encoding is ASCII (and has been that way > since at least 2.6). > > On the other hand, the current version of Python is 3.x, where a big > Unicode revolution has happened and now the default encoding is UTF-8. > > Both of these Pythons recognize Emacs-style and vim-style encoding > declarations, and in addition the UTF-8 byte order mark (which can be > called Notepad-style encoding declaration). > > Thanks clarifying this, so I stand corrected. Andreas