ansii encoding



  • Hi,

    In Belgium, we use the character ë.
    But when I use this character in an app, I get an ansii error.

    How can I solve that?

    THanks.


  • Core team

    In Python 2, you need to specify the encoding of each file. This just means putting the following at the top of each file:

    # coding: utf8
    

    Then, if you want to use a character in a string, put a u character before the quote, e.g.

    screen.text(u'In Belgium, we use the character ë.')
    

    The u character tells Python that this string is a 'unicode' string, which is a different type from the normal strings.


Log in to reply

Looks like your connection to ansii encoding was lost, please wait while we try to reconnect.