My Vim script skills don't go far enough to have a common solution, but what can you do when editing the utf-8 file:
:compiler tidy
:setlocal makeprg=<TAB> [and edit the tidy command line to include -utf8]
:make
Explanation:
": compile tidy" setlocal makeprg (-q -e -gnu-emacs yes). , utf-8 tidy -utf8, . : .
utf8, , , -utf8, . :
:e $VIMRUNTIME/compiler/tidy.vim