Re: convert unicode characters to visibly similar ascii characters

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Laszlo Nagy

    Re: convert unicode characters to visibly similar ascii characters

    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.transla te

    Finally

    print s.encode('ascii ')

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

    Best,

    Laszlo

Working...