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


Groups > comp.lang.python > #91305

Re: Fwd: Lossless bulletproof conversion to unicode (backslashing) (fwd)

Path csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <lac@openend.se>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'anyway.': 0.04; 'url:pipermail': 0.05; 'bytes.': 0.07; 'rest,': 0.07; '-------': 0.09; 'received:openend.se': 0.09; 'received:theraft.openend.se': 0.09; 'stdout': 0.09; 'cc:addr:python-list': 0.10; 'python': 0.11; 'question.': 0.13; 'wed,': 0.15; 'anatoly': 0.16; 'cc:addr:lac': 0.16; 'cc:addr:openend.se': 0.16; 'decode': 0.16; 'from:addr:lac': 0.16; 'from:addr:openend.se': 0.16; 'from:name:laura creighton': 0.16; 'message-id:@fido.openend.se': 0.16; 'received:89.233': 0.16; 'received:89.233.217': 0.16; 'received:89.233.217.133': 0.16; 'received:fido': 0.16; 'received:fido.openend.se': 0.16; 'subject:unicode': 0.16; 'url:thread': 0.16; 'wrote:': 0.16; 'bytes': 0.18; 'laura': 0.18; 'cc:addr:python.org': 0.21; 'cc:2**1': 0.22; "aren't": 0.22; 'explicit': 0.22; 'cc:no real name:2**0': 0.23; '2015': 0.23; 'chris': 0.26; 'least': 0.27; 'skip:( 20': 0.28; 'quiet': 0.29; 'received:se': 0.29; 'windows,': 0.29; 'no,': 0.29; 'mode': 0.31; 'print': 0.31; 'url:mailman': 0.31; "can't": 0.32; 'skip:[ 10': 0.32; 'url:python': 0.33; 'problem': 0.33; 'url:listinfo': 0.35; 'cc:': 0.35; 'fail': 0.35; 'text.': 0.35; 'unicode': 0.35; 'list': 0.35; 'being': 0.36; 'text': 0.36; 'url:org': 0.36; 'forwarded': 0.37; 'turn': 0.37; 'subject:: ': 0.37; 'charset:us-ascii': 0.37; 'done.': 0.37; 'list.': 0.37; "won't": 0.38; 'stuff': 0.38; 'end': 0.39; 'means': 0.39; 'pm,': 0.39; 'subject: (': 0.40; 'header:Message-Id:1': 0.62; 'information': 0.62; 'you.': 0.64; 'email addr:python.org"': 0.66; 'python-list': 0.66; 'received:89': 0.80; 'chrisa': 0.84; 'drinking': 0.84; 'everything,': 0.84
To techtonik@gmail.com
cc "python-list@python.org" <python-list@python.org>, lac@openend.se
From Laura Creighton <lac@openend.se>
Subject Re: Fwd: Lossless bulletproof conversion to unicode (backslashing) (fwd)
MIME-Version 1.0
Content-Type text/plain; charset="us-ascii"
Content-ID <15791.1432731421.1@fido>
Content-Transfer-Encoding quoted-printable
Date Wed, 27 May 2015 14:57:01 +0200
X-Greylist Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (theraft.openend.se [89.233.217.130]); Wed, 27 May 2015 14:57:06 +0200 (CEST)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
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.87.1432731440.5151.python-list@python.org> (permalink)
Lines 42
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1432731440 news.xs4all.nl 2871 [2001:888:2000:d::a6]:38682
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:91305

Show key headers only | View raw


Chris Angelico apparantly has a problem with cc'd people who aren't
on the list.  python-list is very quiet these days, so if you
subscribe it won't be drinking from the firehose.  And you can
always turn off delivery when you are done.  Or you can just
go read the archives: https://mail.python.org/pipermail/python-list/2015-May/thread.html

Laura

------- Forwarded Message

Return-Path: <python-list-bounces+lac=openend.se@python.org>
Received: from mail.python.org (mail.python.org [82.94.164.166])
	by theraft.openend.se (8.14.4/8.14.4/Debian-4) with ESMTP id t4RC09ap02From: Chris Angelico <rosuav@gmail.com>
Cc: "python-list@python.org" <python-list@python.org>


On Wed, May 27, 2015 at 9:52 PM, anatoly techtonik <techtonik@gmail.com> wrote:
> And the short answer is that we need unicode because we are printing this
> information to the stdout, and stdout is opened in text mode at least on
> Windows, and without explicit conversion, Python will try to decode stuff
> as being `ascii` and fail anyway.

So you're working with text. That means you HAVE to decode it somehow;
you fundamentally cannot print bytes to the console. Lossless
concealment of arbitrary bytes won't help you. If you can't adequately
decode everything, either backslash-escape the rest, or use a
replacement character; you can't print out those bytes.

And no, I will not cc you. Subscribe to the list if you're going to
ask a question.

ChrisA
- -- 
https://mail.python.org/mailman/listinfo/python-list

------- End of Forwarded Message

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


Thread

Re: Fwd: Lossless bulletproof conversion to unicode (backslashing) (fwd) Laura Creighton <lac@openend.se> - 2015-05-27 14:57 +0200

csiph-web