Revert part of commit 46dc9890 "Don't switch encoding for internal parameter entities" that caused spurious warnings. Fixes bug 786267.