When to use utf8 as a header in py files

后端 未结 5 1561
误落风尘
误落风尘 2021-02-05 05:32

Some source files, from downloaded code, have the following header

# -*- coding: utf-8 -*-

I have an idea what utf-8 encoding is but why would

5条回答
  •  梦谈多话
    2021-02-05 05:58

    When you use non-ascii characters. For instance when I comment my source in norwegian if charachters ØÆÅ occur in the .py it will complain and not "compile".

提交回复
热议问题