Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!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.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subject:skip:s 10': 0.05; "'replace')": 0.16; '-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; 'us-ascii': 0.16; "i'd": 0.22; "i've": 0.23; 'header:User- Agent:1': 0.26; 'possible,': 0.27; "doesn't": 0.28; 'becomes': 0.30; 'to:addr:python-list': 0.33; 'text': 0.34; 'subject:?': 0.35; 'there': 0.35; 'but': 0.36; 'stock': 0.36; 'anything': 0.36; 'to:addr:python.org': 0.39; 'subject:-': 0.40; 'information': 0.63; 'received:50.22': 0.84; 'to:name:python': 0.84 Date: Thu, 13 Sep 2012 16:26:07 -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: Python Subject: Least-lossy string.encode to us-ascii? Content-Type: text/plain; charset=UTF-8 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: 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: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1347571498 news.xs4all.nl 6973 [2001:888:2000:d::a6]:52813 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:29077 I've got a bunch of text in Portuguese and to transmit them, need to have them in us-ascii (7-bit). I'd like to keep as much information as possible, just stripping accents, cedillas, tildes, etc. So "serviço móvil" becomes "servico movil". Is there anything stock that I've missed? I can do mystring.encode('us-ascii', 'replace') but that doesn't keep as much information as I'd hope. -tkc