Use encodeURIcomponent instead and provide correct UTF-chars in JS.