Fix encoding problems for editable pages

Fixes #21.