Peter Bulychev wrote:
Thank you for you answer.

    If you only want this to work for a subset, please define that subset.

Actually, I want to convert only punctuations (dots, commas, hyphens and so on).
Then make your translation table manually and apply this method:

unicode.translate

Finally

print s.encode('ascii')

If you get an UnicodeEncodeError then it means you had other (not translated, non-ascii) characters in the original string.

Best,

  Laszlo

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to