Support RFC6266 encoded filenames

This reapplies the commits from #1531 to master, fixing the merge conflicts and file path changes. It also implements the changes requested in #1531 and includes support for encoded language fields. Let me know if any additional changes are required.