For those like me who are having problems with non english words.
Code:
if ($vbulletin->options['amp_auto_tagger_enabled'] && THIS_SCRIPT == 'newthread'){
$taggerbadwords = str_replace(" ","",$vbulletin->options["amptaggerbadwords"]);
$taggerbadwords = str_replace(",","\b|",$vbulletin->options["amptaggerbadwords"]);
//$taggerbadwords = str_replace(" ","\b|",$vbulletin->options["badwords"]);
$tagscript = '<script type="text/javascript">
function removeAccents(strAccents){
strAccents = strAccents.split("");
strAccentsOut = new Array();
strAccentsLen = strAccents.length;
var accents =
"??????????????????????????????????????????????????????????????";
var accentsOut =
["A","A","A","A","A","A","a","a","a","a","a","a","O","O","O","O","O","O","O"
,"o","o","o","o","o","o","E","E","E","E","e","e","e","e","e","C","c","D","I"
,"I","I","I","i","i","i","i","U","U","U","U","u","u","u","u","N","n","S","s"
,"Y","y","y","Z","z"];
for (var y = 0; y < strAccentsLen; y++) {
if (accents.indexOf(strAccents[y]) != -1) {
strAccentsOut[y] = accentsOut[accents.indexOf(strAccents[y])];
}
else
strAccentsOut[y] = strAccents[y];
}
strAccentsOut = strAccentsOut.join("");
return strAccentsOut;
}
function filterText(sText) {
var reBadWords = /'.$taggerbadwords.'\b/gi;
return sText.replace(reBadWords, "");
}
function ltrim(str){
return str.replace(/^[ ]+/, "");
}
function rtrim(str){
return str.replace(/[ ]+$/, "");
}
function trim(str){
return ltrim(rtrim(str));
}
function updateTagger(){
var subject = document.vbform.subject.value.replace(/[^a-zA-Z 0-9??????????????????????????????????????????????????????????????]+/gi,"");
subject = removeAccents(subject);
subject = subject.replace(/(\b(\w{1,3})\b(\s|$))|(\b(\w{19,})\b(\s|$));,./g," ");
var newtaglist = filterText(subject);
newtaglist = trim(newtaglist);
newtaglist = newtaglist.replace(/\s+/g," ");
document.vbform.taglist.value = newtaglist.replace(/ /gi,",");
}
</script>';
$tagscript2 = 'onBlur="updateTagger()"';
$search = 'name="subject" id="subject"';
$replace = 'name="subject" id="subject" '.$tagscript2;
$vbulletin->templatecache['newthread'] = str_replace($search, $replace, $vbulletin->templatecache['newthread']);
$search = '<form class="vbform block"';
$replace = $tagscript.'<form class="vbform block"';
$vbulletin->templatecache['newthread'] = str_replace($search, $replace, $vbulletin->templatecache['newthread']);
}