Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'exception': 0.03; 'ascii': 0.07; 'currency': 0.07; 'subject:How': 0.09; 'encode': 0.09; 'holdings': 0.09; 'leaks': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:()': 0.09; 'subject:string': 0.09; 'subject:using': 0.09; 'encoding': 0.15; 'americans': 0.16; 'ascii,': 0.16; 'codec': 0.16; 'collapse': 0.16; 'ordinal': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject: \n ': 0.16; 'subject:unicode': 0.16; 'subject:variable': 0.16; '\xe9crit': 0.16; 'wrote:': 0.17; 'mostly': 0.20; '"",': 0.22; 'tonight': 0.22; "i'd": 0.22; "haven't": 0.23; 'seems': 0.23; 'paul': 0.24; 'least': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; '(most': 0.27; 'pages,': 0.27; '(as': 0.27; 'header:X-Complaints-To:1': 0.28; '>>>>': 0.29; 'fast.': 0.29; 'sensible': 0.29; 'character': 0.29; '8bit%:5': 0.29; 'e.g.': 0.30; 'code': 0.31; 'point': 0.31; 'file': 0.32; 'from:addr:yahoo.co.uk': 0.32; "skip:' 20": 0.32; 'traceback': 0.33; 'to:addr:python-list': 0.33; '(with': 0.33; "can't": 0.34; 'received:org': 0.36; 'except': 0.36; 'but': 0.36; 'characters': 0.36; 'stock': 0.36; 'uses': 0.37; 'subject:: ': 0.38; 'mark': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'skip:u 10': 0.60; 'world': 0.63; 'email addr:gmail.com': 0.63; 'more': 0.63; 'charset:windows-1252': 0.65; 'producers': 0.65; 'europe': 0.66; 'news': 0.68; 'euros.': 0.84; 'subject:value': 0.84; 'banking': 0.89; 'imagine': 0.96 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: How do I display unicode value stored in a string variable using ord() Date: Sun, 19 Aug 2012 19:50:13 +0100 References: <308df2af-abe7-4043-b199-0a39f440e0ab@googlegroups.com> <502f8a2a$0$29978$c3e8da3$5496439d@news.astraweb.com> <7xehn4vyya.fsf@ruckus.brouhaha.com> <5030832d$0$29978$c3e8da3$5496439d@news.astraweb.com> <7x8vdbmho6.fsf@ruckus.brouhaha.com> <7xfw7ilqnd.fsf@ruckus.brouhaha.com> <28f35cee-3e55-43af-afc8-1ded199c53d9@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: host-78-146-9-229.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:14.0) Gecko/20120713 Thunderbird/14.0 In-Reply-To: <28f35cee-3e55-43af-afc8-1ded199c53d9@googlegroups.com> X-Antivirus: avast! (VPS 120819-0, 19/08/2012), Outbound message X-Antivirus-Status: Clean 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: 41 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1345402115 news.xs4all.nl 6920 [2001:888:2000:d::a6]:56644 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27421 On 19/08/2012 19:11, wxjmfauth@gmail.com wrote: > Le dimanche 19 août 2012 19:48:06 UTC+2, Paul Rubin a écrit : >> >> >> But they are not ascii pages, they are (as stated) MOSTLY ascii. >> >> E.g. the characters are 99% ascii but 1% non-ascii, so 393 chooses >> >> a much more memory-expensive encoding than UTF-8. >> >> > > Imagine an us banking application, everything in ascii, > except ... the € currency symbole, code point 0x20ac. > > Well, it seems some software producers know what they > are doing. > >>>> '€'.encode('cp1252') > b'\x80' >>>> '€'.encode('mac-roman') > b'\xdb' >>>> '€'.encode('iso-8859-1') > Traceback (most recent call last): > File "", line 1, in > UnicodeEncodeError: 'latin-1' codec can't encode character '\u20ac' > in position 0: ordinal not in range(256) > > jmf > Well that's it then, the world stock markets will all collapse tonight when the news leaks out that those stupid Americans haven't yet realised that much of Europe (with at least one very noticeable and sensible exception :) uses Euros. I'd better sell all my stock holdings fast. -- Cheers. Mark Lawrence.