support arbitrary encodings in managed files (closes #32)