unicode to ascii converting

Skip Montanaro skip at pobox.com
Tue Aug 10 12:27:20 EDT 2004


    Michel> # -*- coding: cp1252 -*-
    Michel> aa = u"ä"
    Michel> aa.encode("ascii","ignore")

A somewhat less destructive solution might be to try my latscii codec:

    http://manatee.mojam.com/~skip/python/latscii.py

(assuming your input is encoded as latin-1).

Skip



More information about the Python-list mailing list