Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!news.unit0.net!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; 'subject:: [': 0.03; 'subject:skip:s 10': 0.05; 'cc:addr:python-list': 0.10; '-tkc': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'message-id:@tim.thechases.com': 0.16; 'received:70.251': 0.16; 'received:dsl.rcsntx.swbell.net': 0.16; 'received:rcsntx.swbell.net': 0.16; 'received:swbell.net': 0.16; 'threw': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'subject:] ': 0.19; 'import': 0.21; 'cc:2**0': 0.23; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'skip:" 20': 0.26; 'thanks!': 0.26; 'subject:?': 0.35; 'skip:u 20': 0.36; 'subject:-': 0.40; 'received:50.22': 0.84 Date: Thu, 13 Sep 2012 17:06:25 -0500 From: Tim Chase User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111120 Icedove/3.1.16 MIME-Version: 1.0 To: Vlastimil Brom Subject: Re: [SOLVED] Least-lossy string.encode to us-ascii? References: <50524F6F.6070604@tim.thechases.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com X-Source: X-Source-Args: X-Source-Dir: Cc: Python 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: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1347573916 news.xs4all.nl 6967 [2001:888:2000:d::a6]:39809 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:29081 On 09/13/12 16:44, Vlastimil Brom wrote: > >>> import unicodedata > >>> unicodedata.normalize("NFD", u"serviço móvil").encode("ascii", "ignore").decode("ascii") > u'servico movil' Works well for all the test-cases I threw at it. Thanks! -tkc