Allowing for UTF-8 characters in Python source code

By default, Python cannot deal with non-ASCII characters in source files, such as the following line:

The file encoding can be signalized by adding a magic comment in either the first or second line of the file:

 References

  • [1] More information in the Python Enhancement Proposals index

Leave a Reply