Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'interpreter': 0.05; 'received:verizon.net': 0.07; 'terry': 0.07; 'python': 0.08; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:string': 0.09; 'utf-8': 0.09; 'am,': 0.12; 'op.': 0.16; 'reedy': 0.16; 'subject:unicode': 0.16; 'wrote:': 0.16; '3.2': 0.18; 'bytes': 0.18; 'jan': 0.19; 'header:In-Reply-To:1': 0.22; '(on': 0.23; 'string': 0.24; 'command': 0.24; 'byte': 0.24; 'windows': 0.26; 'pm,': 0.26; 'idle': 0.28; 'unicode': 0.28; 'pasted': 0.30; 'unicode,': 0.30; 'michael': 0.31; 'does': 0.32; 'header:User-Agent:1': 0.33; 'to:addr:python-list': 0.33; 'changing': 0.34; 'header:X-Complaints-To:1': 0.34; 'uses': 0.36; 'went': 0.36; 'encoding': 0.36; 'two': 0.37; 'but': 0.37; 'received:org': 0.37; 'should': 0.38; 'subject:: ': 0.39; 'to:addr:python.org': 0.40; 'type': 0.60; 'soon': 0.71; '(unicode)': 0.84; '12:21': 0.84; 'add-on': 0.84; 'window,': 0.84; '3.3': 0.91; 'mine,': 0.91; 'stupid': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: to express unicode string Date: Sat, 28 Jan 2012 18:03:41 -0500 References: <4F245367.1010902@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Gmane-NNTP-Posting-Host: pool-74-109-121-73.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: <4F245367.1010902@gmail.com> 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1327792744 news.xs4all.nl 6984 [2001:888:2000:d::a6]:33566 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:19561 On 1/28/2012 2:58 PM, Michael Torrie wrote: > On 01/28/2012 12:21 AM, contro opinion wrote: >>>>> s=3D'=E4=BD=A0=E5=A5=BD' > > On my computer, s is a byte string that contains the utf-8 formatted > encoding of =E4=BD=A0=E5=A5=BD. On mine, s is a (unicode) string containing those two characters. That=20 is because I pasted the above into IDLE 3.2.2 (on Win7, but should be=20 the same on all systems). (Pasting into the standard interpreter window, = which uses Windows stupid Command Prompt interface, does not work.) To the OP. if you want to work easily with unicode, use Python 3.2 now=20 and Python 3.3 as soon as it comes out, in less than a year. We went=20 through the hassle of changing the string type from bytes to unicode=20 *because* having unicode as merely an add-on type was not working very we= ll. --=20 Terry Jan Reedy