[Python] How to convert an UTF string with scandinavian characters to ASCII?

Discussão em 'Python' iniciado por Stack, Maio 30, 2025.

  1. Stack

    Stack Membro Participativo

    I would like to convert this string

    foo_utf = u'nästy chäräctörs with å and co.' # unicode


    into this

    foo_ascii = 'nästy chäräctörs with å and co.' # ASCII


    .

    Any idea how to do this in Python (2.6)? I found unicodedata module but I have no idea how to do the transformation.

    Continue reading...

Compartilhe esta Página