The source code of the Stenway ReliableTXT reference library can be found on GitHub
import sys import stenway.reliabletxt from stenway.reliabletxt import * document = ReliableTxtDocument("abc\U00020007\u6771", ReliableTxtEncoding.UTF_16) document.setCodePoints([0x61, 0x20007, 0x62]) print(document.getCodePoints()) document.save("Test.txt")