From owner-freebsd-python@FreeBSD.ORG Thu Jan 29 07:42:32 2015 Return-Path: Delivered-To: freebsd-python@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF1CCFD6 for ; Thu, 29 Jan 2015 07:42:32 +0000 (UTC) Received: from mail-ie0-x22d.google.com (mail-ie0-x22d.google.com [IPv6:2607:f8b0:4001:c03::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CE96D96 for ; Thu, 29 Jan 2015 07:42:32 +0000 (UTC) Received: by mail-ie0-f173.google.com with SMTP id tr6so30310038ieb.4 for ; Wed, 28 Jan 2015 23:42:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=Wt4Rr3ZMZwi+OUWSfdjVbN/RRt5ZlNTYNgtow108TeY=; b=rgIlDDloKikDAObjniu788QcKPWNvPAgz3QQzuZxw0A23hvVf1UVuoPGosaGT7Hb9E FYm6YrEP2IwMKmu4PAW6gcDEpCnjCLr4rXcQYRKtWMJ58KDY2oP3+xFgcPNf5LaW0kPj eFx3L700lV0ZopQq/lccN4OjjfXcQXUL0qHH1sDrlOM4OPIKt7h9QJOq3oyVShT8i3m2 S3LY+2W4MQFatXMpvCinTyP5n1n7RfLZSz5cYOgM8En99qCtOz0/1xfyc9Ma+NkNRO1K 2BkZ99crk4Jox+uytdGta7wKHMOtGpF9kSoPEscs4ohu7erBgUny8CPXOl7JAMmkSjQZ 8alQ== MIME-Version: 1.0 X-Received: by 10.42.199.211 with SMTP id et19mr1493379icb.9.1422517351903; Wed, 28 Jan 2015 23:42:31 -0800 (PST) Received: by 10.36.8.215 with HTTP; Wed, 28 Jan 2015 23:42:31 -0800 (PST) In-Reply-To: <20150129072908.GA37127@slackbox.erewhon.home> References: <20150129072908.GA37127@slackbox.erewhon.home> Date: Thu, 29 Jan 2015 02:42:31 -0500 Message-ID: Subject: Re: Unicode Problem From: Robert Simmons To: Robert Simmons , freebsd-python@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2015 07:42:32 -0000 What is the output from print(sys.stdout.encoding) on your system? And, can you explain how to change that on mine so that it is UTF-8? Mine is a default fresh install, btw. On Thu, Jan 29, 2015 at 2:29 AM, Roland Smith wrote: > On Thu, Jan 29, 2015 at 01:38:21AM -0500, Robert Simmons wrote: >> I'm having a unicode problem on FreeBSD lang/python34 that does not >> appear on MacOS X. I've condensed the problem to one single line to >> enter in the interpreter: >> >> FreeBSD: >> Python 3.4.2 (default, Jan 28 2015, 22:23:57) >> [GCC 4.2.1 Compatible FreeBSD Clang 3.4.1 (tags/RELEASE_34/dot1-final >> 208032)] on freebsd10 >> Type "help", "copyright", "credits" or "license" for more information. >> >>> b'\xc3\xa2'.decode('utf-8') >> '\xe2' >> >> MacOS X: >> Python 3.4.2 (default, Oct 19 2014, 17:55:38) >> [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.54)] on darwin >> Type "help", "copyright", "credits" or "license" for more information. >> >>> b'\xc3\xa2'.decode('utf-8') >> '=C3=A2' >> >> Why is Python on FreeBSD incorrectly decoding this? > > Works fine here (FreeBSD 10.1-STABLE #0 r276653 amd64): > > Python 3.4.2 (default, Nov 4 2014, 19:34:48) > [GCC 4.2.1 Compatible FreeBSD Clang 3.4.1 (tags/RELEASE_34/dot1-final= 208032)] on freebsd10 > Type "help", "copyright", "credits" or "license" for more information= . > >>> b'\xc3\xa2'.decode('utf-8') > '=C3=A2' > > > Roland > -- > R.F.Smith http://rsmith.home.xs4all.nl/ > [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] > pgp: 5753 3324 1661 B0FE 8D93 FCED 40F6 D5DC A38A 33E0 (keyID: A38A33E0)