QTextEncoder

class PyQt5.QtCore.QTextEncoder

C++ documentation