Add back the document encoding specs
Prep encoding/decoding for 1.8