I wonder if this will screw up if the page is being read with a different encoding than UTF-8 or something. It might be better to turn this into "\u1234" sequences.