Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!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; 'python,': 0.02; 'say,': 0.05; 'subject:How': 0.09; '"a"': 0.09; 'happens.': 0.09; 'internally': 0.09; 'lawrence': 0.09; 'subject:()': 0.09; 'subject:string': 0.09; 'subject:using': 0.09; 'stored': 0.10; "wouldn't": 0.11; 'ascii,': 0.16; 'editor,': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'operation.': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'subject: \n ': 0.16; 'subject:unicode': 0.16; 'subject:variable': 0.16; 'ucs-4': 0.16; '\xe9crit': 0.16; 'wrote:': 0.17; 'windows': 0.19; 'least': 0.25; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'facing': 0.29; 'received:192.168.1.3': 0.29; "i'm": 0.29; 'received:84': 0.32; 'to:addr:python-list': 0.33; 'text': 0.34; 'list': 0.35; 'acceptable': 0.35; 'saved': 0.35; 'but': 0.36; 'subject:: ': 0.38; 'mark': 0.38; 'fact': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'remove': 0.61; 'please,': 0.62; 'email addr:gmail.com': 0.63; 'become': 0.65; 'charset:windows-1252': 0.65; 'surprise': 0.65; 'header:Reply- To:1': 0.68; 'everybody': 0.69; 'reply-to:no real name:2**0': 0.72; 'reply-to:addr:python.org': 0.84; 'samedi': 0.84; 'subject:value': 0.84; 'imagine': 0.96 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.0 cv=IekFqBWa c=1 sm=1 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=DKcI9XZsuF4A:10 a=XPIpSzf0io4A:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=N659UExz7-8A:10 a=FI9Gn-gLjTAA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=pGLkceISAAAA:8 a=OF0S1nXjrZKvyQVdBTYA:9 a=pILNOxqGKmIA:10 a=MSl-tDqOz04A:10 a=0nF1XD0wxitMEM03M9B4ZQ==:117 X-AUTH: mrabarnett:2500 Date: Sat, 18 Aug 2012 19:34:50 +0100 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: How do I display unicode value stored in a string variable using ord() References: <308df2af-abe7-4043-b199-0a39f440e0ab@googlegroups.com> <502f8a2a$0$29978$c3e8da3$5496439d@news.astraweb.com> <4c62a649-bc21-4e47-9c0f-acb1b1e70e36@googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: python-list@python.org 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: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1345314897 news.xs4all.nl 6987 [2001:888:2000:d::a6]:59188 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27324 On 18/08/2012 19:05, wxjmfauth@gmail.com wrote: > Le samedi 18 août 2012 19:28:26 UTC+2, Mark Lawrence a écrit : >> >> Proof that is acceptable to everybody please, not just yourself. >> >> > I cann't, I'm only facing the fact it works slower on my > Windows platform. > > As I understand (I think) the undelying mechanism, I > can only say, it is not a surprise that it happens. > > Imagine an editor, I type an "a", internally the text is > saved as ascii, then I type en "é", the text can only > be saved in at least latin-1. Then I enter an "€", the text > become an internal ucs-4 "string". The remove the "€" and so > on. > [snip] "a" will be stored as 1 byte/codepoint. Adding "é", it will still be stored as 1 byte/codepoint. Adding "€", it will still be stored as 2 bytes/codepoint. But then you wouldn't be adding them one at a time in Python, you'd be building a list and then joining them together in one operation.