Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #29077

Least-lossy string.encode to us-ascii?

Date 2012-09-13 16:26 -0500
From Tim Chase <python.list@tim.thechases.com>
Subject Least-lossy string.encode to us-ascii?
Newsgroups comp.lang.python
Message-ID <mailman.640.1347571498.27098.python-list@python.org> (permalink)

Show all headers | View raw


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


Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Least-lossy string.encode to us-ascii? Tim Chase <python.list@tim.thechases.com> - 2012-09-13 16:26 -0500
  Re: Least-lossy string.encode to us-ascii? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-14 03:49 +0000
  Re: Least-lossy string.encode to us-ascii? wxjmfauth@gmail.com - 2012-09-14 09:15 -0700
    Re: Least-lossy string.encode to us-ascii? Terry Reedy <tjreedy@udel.edu> - 2012-09-14 16:43 -0400
      Re: Least-lossy string.encode to us-ascii? wxjmfauth@gmail.com - 2012-09-15 01:58 -0700
      Re: Least-lossy string.encode to us-ascii? wxjmfauth@gmail.com - 2012-09-15 01:58 -0700
  Re: Least-lossy string.encode to us-ascii? wxjmfauth@gmail.com - 2012-09-14 09:15 -0700

csiph-web