Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed1a.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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'encoding': 0.05; 'subject:Python': 0.06; 'bytes.': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'encoding.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'worse.': 0.16; 'java,': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'bytes': 0.24; 'java': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'least': 0.26; 'defined': 0.27; 'header:In-Reply-To:1': 0.27; 'tim': 0.29; 'characters': 0.30; 'especially': 0.30; 'message-id:@mail.gmail.com': 0.30; 'lines': 0.31; 'assumes': 0.31; 'convenience': 0.31; 'subject:some': 0.31; 'convert': 0.35; 'operations': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'surely': 0.36; 'pm,': 0.38; 'that,': 0.38; 'anything': 0.39; 'default': 0.69; '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=Fbv1f5x143jhrvV7XCdP+PBJzMiIbpl3y1F3HMnsW/M=; b=c0VTxoi+ga+MuSAtNEawUdRQkvOrl/IZFLBBuiRP5NH5aWN5+ZqxoQXNgPs7/j3zYd Hqn9xjJCFbMXZ/TJtB0JoXRM4f35KWP5gTXzyF1MFAjHBGoHCN2b7fRf5I33IQKlTGR7 3g7LLkZHbV3ifRSUXETEwyfxI5C25XKcc31r+ljKbjCZ8XW68NSYvLK8Q0p0KY/TsU2l KaEDtFo2JxaP2afJMVophmA2Kqc9S8z4DiV1iXGBpkbqiCIY7aEBD0exbsZ81tkTNli3 9fwhR2mEqnrnCNzb7Mp1d42bzGh14g55XuS6Iv92fDPU4guGuF1vupN3Fq5n399DC8RZ Mmdg== MIME-Version: 1.0 X-Received: by 10.220.249.198 with SMTP id ml6mr554033vcb.36.1401700463481; Mon, 02 Jun 2014 02:14:23 -0700 (PDT) In-Reply-To: References: <538a8f48$0$29978$c3e8da3$5496439d@news.astraweb.com> <538bcfff$0$29978$c3e8da3$5496439d@news.astraweb.com> Date: Mon, 2 Jun 2014 19:14:23 +1000 Subject: Re: Python 3.2 has some deadly infection From: Chris Angelico Cc: Python-List 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1401700886 news.xs4all.nl 2911 [2001:888:2000:d::a6]:43035 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:72402 On Mon, Jun 2, 2014 at 7:02 PM, Tim Delaney wrote: > In Java, it's much worse. At least with Python you can perform string-like > operations on bytes. In Java you have to convert it to characters before you > can really do anything with it, so people just use the default encoding all > the time - especially if they want the convenience of line-by-line reading > using BufferedReader ... What exactly is "line-by-line reading" with bytes? As I understand it, lines are defined by characters. If you mean "reading a stream of bytes and dividing it on 0x0A", then surely you can do that, but that assumes an ASCII-compatible encoding. ChrisA