convert unicode characters to visibly similar ascii characters

Jim jim.hefferon at gmail.com
Tue Jul 1 19:55:28 EDT 2008


Peter Bulychev wrote:
> I want to convert unicode character into ascii one.
You have to make some arbitrary choices of what to translate.  Based
on some materials on  effbot's site, and a recipe, I made
  ftp://alan.smcvt.edu/hefferon/unicode2ascii.py
which has at least some of what you are looking for.
  $ grep HYPHEN unicode2ascii.py
    u'\N{SOFT HYPHEN}':u'-',
    u'\N{HYPHEN}':u'-',
    u'\N{NON-BREAKING HYPHEN}':u'-',
    u'\N{SOFT HYPHEN}': '-',
No doubt I have some terrible gaffes and some things missing.
Corrections appreciated.

Jim



More information about the Python-list mailing list