decode location.pathname

Hi! We have a problem where checkUrl function refreshes the page on Mac browsers when it should not. This happens with urls like /myyjä/ because some browsers return encoded (/myyj%C3%A4/) location.pathname. Would this be acceptable solution for this problem?