Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #59879

Re: [Python-ideas] Unicode stdin/stdout

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <victor.stinner@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:: [': 0.04; 'subject:Python': 0.06; 'utf-8': 0.07; 'locale': 0.09; 'method:': 0.09; 'cc:addr:python-list': 0.11; 'runtime.': 0.16; 'subject:Unicode': 0.16; 'subject:ideas': 0.16; 'replacing': 0.19; 'subject:] ': 0.20; 'cc:addr:python.org': 0.22; 'cc:2**1': 0.23; 'cc:no real name:2**0': 0.24; 'subject:/': 0.26; 'header:In-Reply- To:1': 0.27; 'url:bugs': 0.29; 'message-id:@mail.gmail.com': 0.30; 'open': 0.33; 'url:python': 0.33; 'received:google.com': 0.35; 'add': 0.35; 'there': 0.35; 'url:org': 0.36; 'issue': 0.38; 'rather': 0.38; 'victor': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=WMz4A2cO9bkwT2QCYhzKT54Or8l/OuhWmeORhmyTQ2M=; b=nWJoNekgZiyCXRoRj9FYVd1uZzt+yd5YHTaywvR9XJ3xwvvFU+rZJaxHIxYHL6qA24 XYVqZyIEvwZlQpO6faqkurHRZoZvijgIzFYIu+w3YSeiNGWQ6CG71hqXj7cGGvVkncS8 urgq8MBZMWm2NpJP644VWztwnsRbkzNhrxXE1zUiKhAgLiX8BbNOU67AJPvluNJfTQA6 f/lu/cYCvs/sQowwfI97SMk347yu0lx8Z7j1i3sUbaiSeAZyalTpn44/jGQXpNItWh4A Hyv9cJG8hNKKultaRtJpN15AjThAhvX4ZxAywEyfyIEgWQlCXzzEG1U5jqzpI38LRods RITQ==
X-Received by 10.60.51.7 with SMTP id g7mr21080390oeo.6.1384788352685; Mon, 18 Nov 2013 07:25:52 -0800 (PST)
MIME-Version 1.0
In-Reply-To <528A092D.4060408@chamonix.reportlab.co.uk>
References <5286054F.6000707@chamonix.reportlab.co.uk> <1384539385.17784.47988289.02AE655C@webmail.messagingengine.com> <5289FE6C.7030007@chamonix.reportlab.co.uk> <528A092D.4060408@chamonix.reportlab.co.uk>
From Victor Stinner <victor.stinner@gmail.com>
Date Mon, 18 Nov 2013 16:25:32 +0100
Subject Re: [Python-ideas] Unicode stdin/stdout
To Robin Becker <robin@reportlab.com>
Content-Type text/plain; charset=UTF-8
Cc python-list@python.org, python-ideas <python-ideas@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2850.1384788355.18130.python-list@python.org> (permalink)
Lines 10
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1384788355 news.xs4all.nl 15958 [2001:888:2000:d::a6]:51322
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:59879

Show key headers only | View raw


Why do you need to force the UTF-8 encoding? Your locale is not
correctly configured?

It's better to set PYTHONIOENCODING rather than replacing
sys.stdout/stderr at runtime.

There is an open issue to add a TextIOWrapper.set_encoding() method:
http://bugs.python.org/issue15216

Victor

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: [Python-ideas] Unicode stdin/stdout Victor Stinner <victor.stinner@gmail.com> - 2013-11-18 16:25 +0100

csiph-web