EDIT: the script mentioned in the question, and the other script pointed among the answers, both work just fine with multibyte strings - turned out my problem was elsewhere.
Herkes gibi uygulama biliyor mu? http://phpjs.org/functions/view/469 at komut değil sadece baytlı dizeleri, iyi çalışır.