1st or 2nd line in source code (to have literals in the code utf8-encoded):
# -*- coding: utf-8 -*-
Connection:
db = MySQLdb.connect(host=DB_HOST, user=DB_USER, passwd=DB_PASS, db=DB_NAME,
charset="utf8mb4", use_unicode=True)
For web pages, one of these:
<meta charset=...