Currently mw.util.getUrl() does not support fragments.
mw.util.getUrl( 'Title Ä#Fragment Ä', { useskin: 'vector' } )
evaluates to /wiki/Title_%C3%84%23Fragment_%C3%84?useskin=vector.
Expected result: /wiki/Title_%C3%84?useskin=vector#Fragment_.C3.84