Enforce utf-8 for decoding and ignore decoding errors.
Templates should be in utf-8.
Closes #161