Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3a.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'mrab': 0.05; 'subject:Python': 0.06; 'abuse': 0.07; 'encoded': 0.07; 'subject:file': 0.07; 'utf-8': 0.07; 'string': 0.09; 'yeah,': 0.09; 'cc:addr:python-list': 0.11; 'etc?': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'later': 0.20; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'byte': 0.24; 'cc:2**0': 0.24; 'this:': 0.26; 'header:In-Reply-To:1': 0.27; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'url:wiki': 0.31; 'url:wikipedia': 0.31; 'violation': 0.31; 'ago': 0.33; 'common': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'url:org': 0.36; 'should': 0.36; 'pm,': 0.38; 'heard': 0.39; 'skip:u 10': 0.60; 'first': 0.61; 'become': 0.64; 'to:none': 0.92 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:cc :content-type; bh=19nPUw5V4kKxKhtOOzvhBONgZzU3bCkPkkgVOKhxcsg=; b=VxHT3Ls9t8g7AoAc6Wjt+iO7iBPBCG0aX4/LbirDww8riyWOGJzGyUcUYSq43w3X3m QRIYlJkRO1zLp3A+rhL17MUa7hY6VaCZ5U56ViVvd6UffV8u9xuvwOJxIO9iQ8uYK10+ f8dH8puqoZd7RLY+Wr+b21C6KaXrs4xdevBDikR+DHXvTWoOXWqF6Ntz5NWX/CqUabWD B4Uc6A0HZIpOZlQP+C/pPSYuAweTHDejiuP/T2119vs53McJbxBOyG6A2muFAgT88Ccx MflOSPg10qy4z95yKKEkeYjSdAu1zf6fH6E9IhDvmHDsgIY3bW6iduDGGiZSDJVM9uut W7WQ== MIME-Version: 1.0 X-Received: by 10.221.34.211 with SMTP id st19mr18993574vcb.5.1391225805583; Fri, 31 Jan 2014 19:36:45 -0800 (PST) In-Reply-To: <52EC61FF.4060204@mrabarnett.plus.com> References: <24EAA33389A147D8BC08B029E2209E16@UserPC> <52EC61FF.4060204@mrabarnett.plus.com> Date: Sat, 1 Feb 2014 14:36:45 +1100 Subject: Re: Python shell wont open idle or an exisiting py file From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1391225808 news.xs4all.nl 2873 [2001:888:2000:d::a6]:44810 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65176 On Sat, Feb 1, 2014 at 1:54 PM, MRAB wrote: > I think that some years ago I heard about a variation on UTF-8 > (Microsoft?) where codepoint U+0000 is encoded as 0xC0 0x80 so that the > null byte can be used as the string terminator. > > I had a look on Wikipedia found this: > > http://en.wikipedia.org/wiki/Null-terminated_string Yeah, it's a common abuse of UTF-8. It's a violation of spec, but an understandable one. However, I don't understand why the first part - why should \0 become U+0000 but (presumably) the \a later on (...cs\accel...) doesn't become U+0007, etc? ChrisA