New internal string format in 3.3

Michael Torrie torriem at gmail.com
Tue Aug 21 00:18:38 EDT 2012


On 08/20/2012 07:17 AM, Roy Smith wrote:
> In article <mailman.3538.1345442498.4697.python-list at python.org>,
>  Michael Torrie <torriem at gmail.com> wrote:
> 
>> Python generally tries to follow unicode
>> encoding rules to the letter.  Thus if a piece of text cannot be
>> represented in the character set of the terminal, then Python will
>> properly err out.  Other languages you have tried, likely fudge it
>> somehow.  
> 
> And if you want the "fudge it somehow" behavior (which is often very 
> useful!), there's always http://pypi.python.org/pypi/Unidecode/

Sweet tip, thanks!  I often want to process text that has smart quotes,
emdashes, etc, and convert them to plain old ascii quotes, dashes,
ticks, etc.  This will do that for me without resorting to a bunch of
regexes.  Bravo.



More information about the Python-list mailing list