from io import open
f = open("test", mode="r", encoding="utf-8")
import codecs # Python standard library
codecs.encode("A strange character","utf-8")
# this would give you the utf-8 encoded bytes
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Write your script here...
....