Is there any python "utf-8" string constant?

Viewed 2535

I would like to use "utf-8" string constant because it is always confusing for me to choose between "UTF-8", "UTF8", "utf8", "utf-8", "utf-8", "utf_8"

All code samples in python documentation have syntax like:

with io.open("/tmp/a.txt", "w", encode="utf-8") as file_cursor:
    file_cursor.write(text)

Can somebody tell me why is like this, maybe some best practice, zends ... ?

I would like to use code suggestion in IDE to achieve something like:

with io.open("/tmp/a.txt", "w", encode=ENCODINGS.UTF8) as file_cursor:
    file_cursor.write(text)  

Is there any standard constant out of the box in python core?

1 Answers
Related