Earlier, I've asked this: How to convert some character into five digit unicode one in Python 3.3?
But today I found the Capital U codepoint works when I print, but when I try it in a file, it turns out to fail. Why?
import re
f = codecs.open('test.txt', 'r', encoding="utf-8")
g = codecs.open('test_output.txt', 'w', encoding="utf-8")
fin = f.read()
output = re.sub('m', '\U000243D0', fin)
g.write(output)