Introduce a replacement encoding as a trial balloon to fixing various issues.

Part of https://www.w3.org/Bugs/Public/show_bug.cgi?id=21057 (Also
commit some scripts.)