Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed6.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; 'python.': 0.02; '(python': 0.05; 'say,': 0.05; 'ascii': 0.07; 'scripts': 0.09; 'subject:How': 0.09; 'python': 0.09; 'encode': 0.09; 'subject:()': 0.09; 'subject:string': 0.09; 'subject:using': 0.09; 'terry': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; 'encoding': 0.15; 'slightly': 0.15; '(eg.': 0.16; '3.3.': 0.16; 'circumvent': 0.16; 'codec': 0.16; 'cp1252': 0.16; 'for,': 0.16; 'ordinal': 0.16; 'reedy': 0.16; 'subject:unicode': 0.16; 'subject:variable': 0.16; 'unicode': 0.17; 'jan': 0.18; 'obviously': 0.18; '>>>': 0.18; '"",': 0.22; 'cc:2**0': 0.23; 'work.': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; '(most': 0.27; 'coding': 0.27; 'served': 0.29; 'character': 0.29; '8bit%:5': 0.29; 'this.': 0.29; 'file': 0.32; "skip:' 20": 0.32; 'could': 0.32; 'european': 0.33; 'traceback': 0.33; "can't": 0.34; 'received:google.com': 0.34; 'moved': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'apple': 0.36; 'characters': 0.36; 'enough': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'easier': 0.38; 'some': 0.38; 'things': 0.38; 'called': 0.39; 'from:no real name:2**0': 0.60; 'skip:u 10': 0.60; 'most': 0.61; 'french': 0.64; 'charset:windows-1252': 0.65; 'user,': 0.69; '100%': 0.76; 'products,': 0.78; 'subject:value': 0.84 Newsgroups: comp.lang.python Date: Fri, 17 Aug 2012 10:49:51 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=83.78.180.128; posting-account=ung4FAoAAAC46zhHJ0Nsnuox7M5gDvs_ References: User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 83.78.180.128 MIME-Version: 1.0 Subject: Re: How do I display unicode value stored in a string variable using ord() From: wxjmfauth@gmail.com To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org 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: , Message-ID: Lines: 62 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1345226504 news.xs4all.nl 6896 [2001:888:2000:d::a6]:53198 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27250 Le vendredi 17 ao=FBt 2012 01:59:31 UTC+2, Terry Reedy a =E9crit=A0: > a =3D '=85' >=20 > print(ord(a)) >=20 > >>> >=20 > 8230 >=20 > Most things with unicode are easier in 3.x, and some are even better in= =20 >=20 > 3.3. The current beta is good enough for most informal work. 3.3.0 will= =20 >=20 > be out in a month. >=20 >=20 >=20 > --=20 >=20 > Terry Jan Reedy Slightly off topic. The character '=85', Unicode name 'HORIZONTAL ELLIPSIS', is one of these characters existing in the cp1252, mac-roman coding schemes and not in iso-8859-1 (latin-1) and obviously not in ascii. It causes Py3.3 to work a few 100% slower than Py<3.3 versions due to the flexible string representation (ascii/latin-1/ucs-2/ucs-4) (I found cases up to 1000%). >>> '=85'.encode('cp1252') b'\x85' >>> '=85'.encode('mac-roman') b'\xc9' >>> '=85'.encode('iso-8859-1') # latin-1 Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'latin-1' codec can't encode character '\u2026' in position 0: ordinal not in range(256) If one could neglect this (typographically important) glyph, what to say about the characters of the European scripts (languages) present in cp1252 or in mac-roman but not in latin-1 (eg. the French script/language)? Very nice. Python 2 was built for ascii user, now Python 3 is *optimized* for, let say, ascii user! The future is bright for Python. French users are better served with Apple or MS products, simply because these corporates know you can not write French with iso-8859-1. PS When "TeX" moved from the ascii encoding to iso-8859-1 and the so called Cork encoding, "they" know this and provided all the complementary packages to circumvent this. It was in 199? (Python was not even born). Ditto for the foundries (Adobe, Linotype, ...) jmf