Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'broken': 0.04; 'subject:Python': 0.06; 'subject: -- ': 0.07; 'cc:addr:python- list': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:Unicode': 0.16; 'subject:handling': 0.16; 'wrote:': 0.18; 'skip:p 40': 0.19; '>>>': 0.22; 'cc:addr:python.org': 0.22; 'example.': 0.24; 'unicode': 0.24; '(or': 0.24; 'cc:2**0': 0.24; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'characters': 0.30; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'breaking': 0.31; 'knowledge': 0.35; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'whatever': 0.38; 'batchelder': 0.84; 'is)': 0.84; 'to:none': 0.92; '2013': 0.98 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:content-transfer-encoding; bh=+jrGHmMBdOtPSIMiCsvCYD+j5GCOp+ZC1nPesAqMZMY=; b=M5XJJV77eusxcVVHUYSFfnuROSY7sDr2sKxsweVTumpi4k2j0PkyCI6+iCoucwUeRn cnA7KsMD2vvIKgXkjy5+cnPWOYmIs9MgrDS0U90cAbffALZPZqzO3d47+5Pg/h0KaHVr ql1RfDswqLkWX2hX/dW2NQgYpYMe9pZsGOKlcz4qSbTlhaP2xEl5STn57Z+OnTBAoLeC 21AKZGanHS8nQ1+BYez+oMSZhpHHDFbHhiHHaV0SaEfZ5KsRDQtoZM/qbhrkdF4Hygc0 DxUUIKV2+5tOQmYmA8n5dqtYsGhzjOte3vpxbGUDF/93PIQKh5uPZgICjVzih/2q0itR lJ9g== MIME-Version: 1.0 X-Received: by 10.68.196.193 with SMTP id io1mr33910649pbc.46.1386019382755; Mon, 02 Dec 2013 13:23:02 -0800 (PST) In-Reply-To: References: <529934dc$0$29993$c3e8da3$5496439d@news.astraweb.com> <529CEFB1.2030007@stoneleaf.us> Date: Tue, 3 Dec 2013 08:23:02 +1100 Subject: Re: Python Unicode handling wins again -- mostly From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1386019386 news.xs4all.nl 15957 [2001:888:2000:d::a6]:58834 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:60886 On Tue, Dec 3, 2013 at 8:14 AM, Ned Batchelder wrot= e: > This is where my knowledge about Unicode gets fuzzy. Isn't it the case t= hat > some grapheme clusters (or whatever the right word is) can't be normalize= d > down to a single code point? Characters can accept many accents, for > example. You can't normalize everything down to a single code point, but you can normalize the other way by breaking out everything that can be broken out. >>> print(ascii(unicodedata.normalize("NFKC", "=C3=A4"))) '\xe4' >>> print(ascii(unicodedata.normalize("NFKD", "=C3=A4"))) 'a\u0308' ChrisA