Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.028 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'ascii': 0.07; 'utf-8': 0.09; 'output': 0.11; 'angelico': 0.16; 'ascii,': 0.16; 'encode': 0.16; 'fits': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'header:In-Reply-To:1': 0.21; 'subject:problem': 0.22; 'received:209.85.210.174': 0.23; 'received:mail- iy0-f174.google.com': 0.23; 'definition': 0.26; 'message- id:@mail.gmail.com': 0.28; 'see,': 0.30; 'to:addr:python-list': 0.33; 'chris': 0.34; 'characters': 0.34; 'received:google.com': 0.37; 'something': 0.37; 'received:209.85': 0.37; 'but': 0.38; 'subject:: ': 0.38; 'sometimes': 0.39; 'received:209': 0.39; 'spent': 0.39; 'got': 0.39; 'to:addr:python.org': 0.39; 'more': 0.60; 'world': 0.63; 'difference!': 0.84; 'encodings.': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=3t1QPmWz7EsOiwk3F4D10vXkuuy080kY7OuYTCPTA7M=; b=HE+/HHMiHTrqaIhtw9dvaZSgzf5XNPwt5D7WQo5eThBpWfda3mpNc/3t4HL9WxHpde 8rdtjL499PFvUCh7v6EZrkSr3h6C0PJtKN0RZwmfYOACnlWPZNNcai5+0vVvcKI0eGat eWuiwIowsabbUNJ/dCHz4z9uSjk51SE3+OTIQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=LxDlmP6TORIuPZTyeAEeE0BZbygKIg2zBxpxabTuioIPxfeCBgimuh2jyHUoEWDkxm 0yJ7Mzhk5KCPlVirJ1IbKvUwzzjFf+GkIE6tr0DWFfENG6XKR3ZUpaxv6KzsvNrE7+NJ olhFIOnx4YrtbV3S6gvFQ8DbTlUFtP08h9hrk= MIME-Version: 1.0 In-Reply-To: <4df61b7d$0$31461$a729d347@news.telepac.pt> References: <4df02e04$0$1779$a729d347@news.telepac.pt> <4df137a7$0$30580$a729d347@news.telepac.pt> <4df16f2e$0$30572$a729d347@news.telepac.pt> <8762oewjao.fsf@benfinney.id.au> <4df2340d$0$30577$a729d347@news.telepac.pt> <4df61b7d$0$31461$a729d347@news.telepac.pt> Date: Tue, 14 Jun 2011 00:49:06 +1000 Subject: Re: the stupid encoding problem to stdout From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 14 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1307976550 news.xs4all.nl 49038 [::ffff:82.94.164.166]:37688 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7515 2011/6/14 S=E9rgio Monteiro Basto : > And see, I can send ascii and utf-8 to utf-8 output and never have proble= ms, > but if I send ascii and utf-8 to ascii files sometimes got encode errors. > If something fits inside 7-bit ASCII, it is by definition valid UTF-8. This is not a coincidence. Those hours you've spent grokking this are not wasted, if you now have a comprehension of characters vs encodings. More people in the world need to understand that difference! :) Chris Angelico